Google Play Game Services Plugin API Reference

Google Play Game Services Plugin for Android API Reference


public static void StartPlay(bool allclients)
public static void BeginUserInitiatedSignIn()
public static void SignOut()
public static void SetSignInMessages(string signingInMessage, string signingOutMessage)
public static void UnlockAchievement(string id)
public static void IncrementAchievement(string id,int numSteps)
public static void SubmitScore(string id,long score)
public static void ShowAchievements()
public static void ShowLeaderboards()
public static void ShowInvitationInbox()
public static void ShowInvitePlayers(int minOpponents,int maxOpponents)
public static void SaveToCloud(int stateKey, string data)
public static void LoadFromCloud(int stateKey)
public static void StartQuickGame(int minOpponents,int maxOpponents)
public static void AcceptInviteToRoom(string invId)
public static void LeaveRoom(string roomId)
public static void SendReliableRealTimeMessage(string messageData,string roomId,string recipientParticipantId)
public static void SendUnreliableRealTimeMessage(string messageData,string roomId,string recipientParticipantId)
public static bool IsSignedIn()

Basic Instructions

Preparation

First you need to set up your game in the Google Developer Console, follow this link for detailed instructions on how to do this:

Import the plugin package (GPGSAndroidPlugin.unitypackage)

Now Edit the Manifest File (Plugins\Android\AndroidManifest.xml) with you App ID

<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 123456789" />
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ 123456789" />

Deploy to an Android Device

9 thoughts on “Google Play Game Services Plugin API Reference

  1. hi, seem to have lack of multiplayer functions in your GPGS plugin , when do you planned to add them ( sendinvite etc … ) because at this we can only use it for demo but not in real game :(

  2. Hello, I buy your plugin , and i am try make multiplayer game. I invite a friend whit your SimpleDemo script but mi friend dont recive the invitation , and de Quick Game in your multiplayer game dont logging . You have a solution or i can open your plugin in eclipse? thx.

    • Hi ruben, looks like there may be a bug when using the current AndroidManifest.xml file which is based on AndroidManifestNoAct.xml. Switching to the AndroidManifestAct.xml (rename this to Androidmanifest.xml and amend the two APP_ID lines) seems to fix this. Weirdly it seems to only affect the multiplayer portion of the plugin, I’m looking into it…

  3. Actually the game pops up the welcome tile only for the first time signed in.

    Is there anyway for showing it every time the player gets logged?

  4. Hi i can add the function onSignOutComplete in (UnityGameObjectReceiverMP)
    or i can,t know when i desconect by other function? thx.

  5. hey, my game crash every time i use LeaveRoom(roomid) then begin new quick game. what must i do to start another quick game without quiting the game ?
    also how can i use the friend invites ? can you explain how it works please ?
    i have an invitation box and a show invitation box but not sure how to use them.
    thanks.

  6. Hello, i had purchased this plugin over the asset store, but i have problems integrating it because there’s some kind of conflict merging the manifests that the plugin uses and the manifest from the Prime31’s flurry plugin. Can you help me please? i can send both manifest files if you wish. Thanks! and great work!

    • Yes merging manifests can be tricky, I’ve done a post on it here.
      If that doesn’t help then by all means email me the manifests and I will take a look.

Leave a Reply

Your email address will not be published. Required fields are marked *