Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignInSilently doesn't work on iOS. #227

Open
cinephile231 opened this issue Feb 9, 2023 · 4 comments
Open

SignInSilently doesn't work on iOS. #227

cinephile231 opened this issue Feb 9, 2023 · 4 comments

Comments

@cinephile231
Copy link

cinephile231 commented Feb 9, 2023

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

@cinephile231
Copy link
Author

cinephile231 commented Feb 9, 2023

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.

@cinephile231
Copy link
Author

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.

@Daniil-Mozolevskiy
Copy link

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

@cinephile231
Copy link
Author

cinephile231 commented Mar 28, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants