googlesamples/google-signin-unity

SignInSilently doesn't work on iOS.

cinephile231 opened this issue · 4 comments

SignInSilently doesn't work on iOS. Since 5.0.0, it is said to use restorePreviousSignIn. Is there a solution? Did Google dump Unity users? I want to buy more stock and attend the shareholders' meeting.

https://stackoverflow.com/a/60383848

ChatGPT said,

using UnityEngine;
using GoogleSignIn;

public class GoogleSignInExample : MonoBehaviour
{
    void Start()
    {
        // Try to sign in silently
        GoogleSignIn.DefaultInstance.RestorePreviousSignIn().ContinueWith(
            task =>
            {
                if (task.IsCompleted && task.Result != null)
                {
                    // Sign-in was successful
                    Debug.Log("Signed in as: " + task.Result.DisplayName);
                }
                else
                {
                    // Sign-in was not successful, prompt the user to sign in
                    Debug.Log("Sign-in failed");
                }
            });
    }
}

It is too difficult to launch iOS with Google function.
I'm going to test whether ChatGPT has done bullshit like a paper.

ChatGPT was right. I created a RestorePreviousSignIn method, and SignInSilently works well. It was replaced from 5.0.0, but it was not reflected in this plugin. I could use 5.0.0 or lower, but I couldn't because of various build issues in iOS. I'll upload my edits if I can. Development is difficult, and GitHub is also difficult.

@cinephile231 Hi, please, can you share your sign in class. I did not find RestorePreviousSignIn() method in this plugin =(

@cinephile231 Hi, please, can you share your sign in class. I did not find RestorePreviousSignIn() method in this plugin =(

https://github.com/googlesamples/google-signin-unity/pull/126/files
I followed this. But I'm not sure.