Getting Android leaderboards to work in your Unity game

Use these tips to avoid making the same mistakes I made when getting leaderboards to work in my Android game. For implementation I used the Unity playgamesservices plugin

  • Make sure you are actually publishing your Google play services configuration. On the ‘Configuration’ tab in the Google play console under Play games services > Set up and management, click the publish button in the top right and follow the steps. This doesn’t publish the whole game onto the play store, it just publishes your Play games services settings!
  • Add testers to Play games services. This is different from adding testers to your testing track. Under Play games services > Set up and management click ‘testers’, add your relevant test track, and add tester accounts.
  • Check the OAuth client has the right SHA. If you use the button in Google Play Console to open Google Cloud Platform and create your client, Google Play Console should give you a popup with the right SHA to use. If no SHA appears in the popup, you probably haven’t uploaded a build yet. This will depend on if you are using the Google Play App Signing, but the SHA used for OAuth won’t be the same one generated by the keystore. Find the SHAs in Setup > App integrity in Google Play Console.
Image source
  • Is your OAuth receiving data? The dashboard in Google Cloud Platform should at least be showing errors if it is connected.
  • Set up your consent form in Google Cloud Platform with the right scopes. For leaderboards and log in I didn’t need to add any scopes whatsoever, just left it blank. Couldn’t find any documentation around the scopes, please comment if you know more.
  • Make sure your code is actually running! I had some bugs with bool flags set around my Google play calls which meant they weren’t running.

Information relevant as of the 2nd March 2021.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s