- Home /
Question by
HanSoloYolo · Sep 02, 2017 at 08:42 PM ·
google playgoogle play gamesgooglelogin
What's the difference between PlayGamesPlatform & Social.localUser?
This is my code for Google Play Services Login, which is called by a button press in another class.
public void GoogleLogin()
{
PlayGamesPlatform.Activate();
PlayGamesPlatform.Instance.Authenticate((bool success) =>{
isUserLoggedIn = success;
LoadHighScore();
});
//Social.localUser.Authenticate((bool success) =>
//{
// isUserLoggedIn = success;
// LoadHighScore();
//});
if (isUserLoggedIn)
{
GoogleLogout();
}
}
public void GoogleLogout()
{
PlayGamesPlatform.Instance.SignOut();
isUserLoggedIn = false;
}
You can see that I commented out Social.localUser.Authenticate and replaced it with PlayGamesPlatform.Instance.Authenticate.
It works the same both ways, so what's the difference?
Comment
Answer by newlife · Apr 20, 2018 at 06:13 PM
To me the only difference (that forces to use PlayGamesPlatform instead of Social.localUser) is that there is no way to manually sign out the user with Social.localUser (this is a required feature when developing for Android). So if you plan to release your app on iOS and Android, you have to use Social.localUser for iOS and PlayGamesPlatform for Android.