Hi everyone, I’m trying to add Play Services login to my game. I followed this youtube tutorial to implement it " https://www.youtube.com/watch?v=5D-WcSXZD_U&ab_channel=Coco3D ".
The script works fine in my PC but when I install the APK to my phone, the script just doesn’t work.
I added a Text change to the SignIn method just to check if it is even being called, the method is called in my Project but not on my Android Install.
Below I’m providing the script. Please tell me what I’m doing wrong.
Thank you.
using UnityEngine;
using GooglePlayGames;
using TMPro;
using GooglePlayGames.BasicApi;
public class PlayGamesManager : MonoBehaviour
{
public TextMeshProUGUI detailsText;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
SignIn();
}
public void SignIn()
{
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
detailsText.text = "Button Pressed";
}
internal void ProcessAuthentication(SignInStatus status)
{
if (status == SignInStatus.Success)
{
string name = PlayGamesPlatform.Instance.GetUserDisplayName();
string id = PlayGamesPlatform.Instance.GetUserId();
string ImgUrl = PlayGamesPlatform.Instance.GetUserImageUrl();
detailsText.text = "Success \n" + name;
}
else
{
detailsText.text = "Sign In Failed!";
}
}
// Update is called once per frame
void Update()
{
}
}