npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.intel.googleplaygamesplugin

v1.0.8

Published

googleplaygamesplugin

Downloads

7

Readme

#Cordova Google Play Games Services + iOS Game Center

This plugin is for Cordova Android apps to enable limitted Google Play Games Services API and iOS Game Center

##iOS support

iOS support has been added through a dependency of https://github.com/Wizcorp/phonegap-plugin-gameCenter . We have wrapped the API calls to match below. See the plugin for configuration details.

##Usage

Follow the instructions here on setting up your app in Google Play Dashboard. Make sure you have your application ID for installation.

Please see the instructions online for getting the app id.

##Short version

Go into the Google Play Developer Console -> Game Services -> Add New Game

Fill out the information and type and hit "Save". On the next page, you will see the title and a number next to it. That number is your App Id

##Installing plugin

cordova plugin add com.intel.googleplaygameservices --variable GPSAPPID=“_APPID_”

This will install the plugin, and dependencies in your app. The GPSAPPID is the Application ID you get from Google Play Dashboard when authorizing your application.

To install in the Intel® XDK add the following to your intelxdk.config.additions.xml

<intelxdk:plugin intelxdk:name="googleplaygameservices" intelxdk:value="http://...">
    <intelxdk:param intelxdk:name="GPSAPPID" intelxdk:value="_APPID_" />
</intelxdk:plugin>

###API The JavaScript API is below. Everything is called on the GooglePlayGamesPlugin object

connect()                      call on device ready . This connects the native api

authenticate(success,failure)   Authenticate the user against a google play
                                account.  Will call success or failure functions.
                                If fail, a message will be passed from the google play

logout(success,failure) 		 Sign the user out of Google Play Games Services
								 for your app

addAchievement(achievement_id,success,failure)  unlock the achievement for the user

showAchievements(success,failure)  Show the achievements for the user.
									If there is an error (not logged in),
									the message will be passed in.  This is a
									new activity that gets launched

updateLeaderboardScore(leaderboard_id,score,success,failure)
									Update the score for the selected
									leaderboard for the user

showLeaderboardScore(leaderboard_id,success,failure)
                                    Show the leaderboard.
                                    If there is an error (not logged in),
                                    the message will be passed in the error.  This is a
                                    new activity that gets launched


saveGame(id,data)
                            Save a game to local storage.  Id is the key and data is JSON data
                            If no id is specficied, we use only one save game slot named "default"
                            If an entry exists, we overwrite the data

loadSavedGame(id)
                            Load a saved games data.
                            If no id is specified, we load the "default" saved game state.

deleteSavedGame(id)
                            Delete a saved game from local storage.
                            If no id is specified, we delete the "default" saved game state.

getAllSavedGames()
                            Returns an object with all the saved games.
                            The key is the id used to save.

###NOTES

Achievements and leaderboards are created in the Google Play Dashboard. They will give you a string parameter for you to call the functions with.

###Testing

To test your app, you must build your application and submit it as an Alpha APK. Next go to go to Google Play Developer Console -> Game Services and link your application to the game service you created. After they are linked, you can enable testing for both.

https://developers.google.com/games/services/console/testpub#enabling_accounts_for_testing

Make sure in the game service you created, you have also added the user under "Testing"

###Adding API's

This is a small subset of the Google Play Games Services API, but can easily be extended. Feel free to fork and contribute extended the API's. Any API's that reuqire a new activity, like logging in, should be implemented in GooglePlayGamesServices.java . All other API's can be added to GooglePlayGamesPlugin.java