You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app is crashing in when i call Social.localUser.Authenticate((bool success) ..
but when i comment these .RequestEmail() .RequestServerAuthCode(false) my app work correctly but i receive the Email of the user as Empty String.
Thanks for your Help in advance.
This is my Full Code:
`using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
using TMPro;
using UnityEngine;
public class GooglePlayLogin : MonoBehaviour {
public TextMeshProUGUI TextDebug,DebugEmail;
void Start () {
PlayGamesConfig();
}
private void Update()
{
// Im testing in Update to get the Email
if(DebugEmail.text == null || DebugEmail.text == "" )
{
GetUserInfo();
}
}
private void PlayGamesConfig()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequestEmail()
.RequestServerAuthCode(false)
.Build();
PlayGamesPlatform.InitializeInstance(config);
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = false;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
}
public void GooglePlayGamesLogin()
{
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
TextDebug.text = success.ToString();
GooglePlayGames.OurUtils.PlayGamesHelperObject.RunOnGameThread(
() => {
TextDebug.text += ((PlayGamesLocalUser)Social.localUser).Email ;
TextDebug.text += PlayGamesPlatform.Instance.GetServerAuthCode();
});
}
else
{
// handle success or failure
TextDebug.text = success.ToString();
}
});
}
public void GetUserInfo()
{
DebugEmail.text += ((PlayGamesLocalUser)Social.localUser).Email;
DebugEmail.text += PlayGamesPlatform.Instance.GetUserEmail();
}
public void UserSignOut()
{
PlayGamesPlatform.Instance.SignOut();
}
}`
The text was updated successfully, but these errors were encountered:
Hello Guys,
My app is crashing in when i call Social.localUser.Authenticate((bool success) ..
but when i comment these
.RequestEmail() .RequestServerAuthCode(false)
my app work correctly but i receive the Email of the user as Empty String.Thanks for your Help in advance.
This is my Full Code:
`using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
using TMPro;
using UnityEngine;
public class GooglePlayLogin : MonoBehaviour {
}
}`
The text was updated successfully, but these errors were encountered: