Google Play Services API vs Unity's Social class

Currently im working on a 2D game project that should work with Google Play Services and i’m kinda confused…
what is difference between using the Social class of Unity or GooglePlayGames namespace? just for basic functions(Login into Google, sign out etc…)

(1)
PlayGamesPlatform.Instance.GetUserId();
Social.localUser.userName;

(2)
if (Social.localUser.authenticated) { }
if (PlayGamesPlatform.Instance.IsAuthenticated()) { }

I guess that both functions do the same thing?

1 Like

I need to know the answer for this too.

From the documentation:

Since it’s a unified interface, it means as long as you use this interface… no matter the ISocialPlatform you set to Social.Active property, you can access it the same way:

This means technically speaking you should be able to implement your own interfaces with varying social platforms just by implementing the ISocialPlatform interface:

How this differs from using the GooglePlayServices API is that:

  1. you don’t have to integrate the api, instead unity has it baked in (if you’re on the appropriate platform that is)
  2. the interface is generalized, so that way you don’t have to right completely different code for each and every social platform… but instead just write code against the generalized Social API which is made possible by ISocialPlatform
  3. the interface is generalize, meaning that specialized stuff specific to a given platform is not accessible… you can only to the basics, since the interface is general

If all you need is simple trophies, authentication, etc… then use the Social API. It works, and if you compile for both Android and iOS, they’ll both just work… no need for 2 separate API includes.

If you need specialized access to the social platform api’s, because you want to use a specific GameCenter or Google Play Services features, that is not part of the generalized Unity Social API… then import the necessary API and use it.

2 Likes