Skip to content
Back to search

play-games-plugin-for-unity

Google Play Games plugin for Unity

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/playgameservices--play-games-plugin-for-unity/badge.svg)](/listings/playgameservices--play-games-plugin-for-unity)

HTML

<a href="/listings/playgameservices--play-games-plugin-for-unity"><img src="/api/listings/playgameservices--play-games-plugin-for-unity/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 94 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Google Play Games plugin for Unity
  2. _Copyright (c) 2014 Google Inc. All rights reserved._
  3. The Google Play Games plugin for Unity&reg; is an open-source project whose goal
  4. is to provide a plugin that allows game developers to integrate with
  5. the Google Play Games API from a game written in Unity&reg;. However, this project is
  6. not in any way endorsed or supervised by Unity Technologies.
  7. _Unity&reg; is a trademark of Unity Technologies._
  8. _iOS is a trademark of Apple, Inc._
  9. ## Downloads
  10. Please download the package from the [Github release page](https://github.com/playgameservices/play-games-plugin-for-unity/releases).
  11. ## Overview
  12. The Google Play Games plugin for Unity allows you to access the Google Play Games
  13. API through Unity's [social interface](http://docs.unity3d.com/Documentation/ScriptReference/Social.html).
  14. The plugin provides support for the
  15. following features of the Google Play Games API:<br/>
  16. * sign in
  17. * friends
  18. * unlock/reveal/increment achievement
  19. * post score to leaderboard
  20. * cloud save read/write
  21. * show built-in achievement/leaderboards UI
  22. * events
  23. * [nearby connections](NEARBY.md)
  24. __NOTICE__: This version of the plugin no longer supports iOS. Google Play games services for iOS is deprecated,
  25. and is not likely to function as expected. Do not use Google Play games
  26. services for iOS in new apps. See the [deprecation announcement](https://android-developers.googleblog.com/2017/04/focusing-our-google-play-games-services.html) blog post for more details.
  27. Features:
  28. * easy GUI-oriented project setup (integrated into the Unity GUI)
  29. * no need to override/customize the player Activity
  30. * no need to override/customize AndroidManifest.xml
  31. ## Documentation
  32. For instructions on using the plugin, please refer to [this developer guide](https://developer.android.com/games/pgs/unity/unity-start).
  33. For a sample application demonstrating how to use Google Play Games see [SmokeTest](https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/Samples/SmokeTest) project;
  34. ## Upgrading
  35. If you have already integrated your project with a previous version of the
  36. plugin and wish to upgrade to a new version, please refer to the
  37. [upgrade instructions](UPGRADING.txt).
  38. ## Decreasing apk size
  39. It is possible to decrease the size of the Play Games Services Unity Plugin by removing code for the Play Games Services features that your game doesn’t use by using Proguard. Proguard will remove the Play Games Unity plugin code for features that are not used in your game, so your game ships with only the code that is needed and minimizes the size impact of using Play Games Services.
  40. Additionally, it is possible to reduce the size of the entire Unity project using Unity’s [Managed Code Stripping](https://docs.unity3d.com/Manual/ManagedCodeStripping.html), which will compress your entire project. This can be used in conjunction with Proguard.
  41. ### Play Games Services Proguard configuration
  42. 1. Go to `File > Build Settings > Player Settings` and click `Publishing Settings` section. Choose `Proguard` for `Minify > Release`. Then, enable `User Proguard File`. If you want the plugin to be proguarded for debug apks as well, you can choose `Proguard` for `Minify > Debug`.
  43. 2. Copy the content of [the proguard configuration](scripts/proguard.txt) into `Assets/Plugins/Android/proguard-user.txt`.
  44. ## (Advanced) Using the Plugin Without Overriding the Default Social Platform
  45. When you call `PlayGamesPlatform.Activate`, Google Play Games becomes your default social platform implementation, which means that static calls to methods in `Social` and `Social.Active` will be carried out by the Google Play Games plugin. This is the desired behavior for most games using the plugin.
  46. However, if for some reason you wish to keep the default implementation accessible (for example, to use it to submit achievements and leaderboards to a different social platform), you can use the Google Play Games plugin without overriding the default one. To do this:
  47. 1. Do not call `PlayGamesPlatform.Activate`
  48. 2. If `Xyz` is the name of a method you wish to call on the `Social` class, do not call `Social.Xyz`. Instead, call `PlayGamesPlatform.Instance.Xyz`
  49. 3. Do not use `Social.Active` when interacting with Google Play Games. Instead, use `PlayGamesPlatform.Instance`.
  50. That way, you can even submit scores and achievements simultaneously to two or more social platforms:
  51. ```csharp
  52. // Submit achievement to original default social platform
  53. Social.ReportProgress("MyAchievementIdHere", 100.0f, callback);
  54. // Submit achievement to Google Play
  55. PlayGamesPlatform.Instance.ReportProgress("MyGooglePlayAchievementIdHere", 100.0f, callback);
  56. ```
  57. ## Special Thanks
  58. This section lists people who have contributed to this project by writing code, improving documentation or fixing bugs.
  59. * [Dgizusse](https://github.com/Dgizusse) for figuring out that setting JAVA_HOME is necessary on Windows.
  60. * [antonlicht](https://github.com/antonlicht) for fixing a bug with the parameter type of showErrorDialog on the support library.
  61. * [pR0Ps](https://github.com/pR0Ps) for fixing an issue where OnAchievementsLoaded was not accepting an OPERATION_DEFERRED result code as a success.
  62. * [friikyeu](https://github.com/friikyeu) for helping debug [an issue](https://github.com/playgameservices/play-games-plugin-for-unity/issues/25) that caused API calls to be queued up rather than executed even when connected.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.