@kukuzla

При включении RequestServerAuthCode, перестаёт работать аутентификация Google Play Game Sevices. Как исправить?

Не удаётся аутентифицировать пользователя через Google Play Games со включенной опцией RequestServerAuthCode.
Не даже появляется анимация, которая должна быть при входе
Код:
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
        .RequestServerAuthCode(false)
        .Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate(success =>
        {
            if (success)
            {
                string authCode = PlayGamesPlatform.Instance.GetServerAuthCode();
                Debug.Log("Authcode - " + authCode);
                FirebaseAuth(authCode);
            }
            else
            {
                Debug.Log("login fail");
            }
        });


вывод logcat
09-05 17:43:58.225 27511 27607 I Unity   : Company Name: DefaultCompany
09-05 17:43:58.225 27511 27607 I Unity   : Product Name: Product
09-05 17:44:00.625 27511 27511 I Unity   : WRITE_EXTERNAL_STORAGE permission granted
09-05 17:44:00.625 27511 27511 I Unity   : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
09-05 17:44:00.625 27511 27511 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
09-05 17:44:00.625 27511 27511 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
09-05 17:44:00.625 27511 27511 I Unity   :
09-05 17:44:00.632 27511 27607 I Unity   : Starting Auth with token client.
09-05 17:44:00.632 27511 27607 I Unity   : GooglePlayGames.Android.AndroidClient:Authenticate(Boolean, Action`1)
09-05 17:44:00.632 27511 27607 I Unity   : GPGSManager:Start()
09-05 17:44:00.632 27511 27607 I Unity   :
09-05 17:44:00.635 27511 27607 I Unity   : LifesManager:Start()
09-05 17:44:00.635 27511 27607 I Unity   :
09-05 17:44:00.636 27511 27607 I Unity   : time gone: 7
09-05 17:44:00.636 27511 27607 I Unity   : seconds left before exit: 1800
09-05 17:44:00.636 27511 27607 I Unity   : LifesManager:Start()
09-05 17:44:00.636 27511 27607 I Unity   :
09-05 17:44:00.666 27511 27607 I Unity   : Firebase Cloud Messaging API Initialized
09-05 17:44:00.666 27511 27607 I Unity   : Firebase.AppUtilPINVOKE:PollCallbacks()
09-05 17:44:00.666 27511 27607 I Unity   : Firebase.AppUtil:PollCallbacks()
09-05 17:44:00.666 27511 27607 I Unity   : Firebase.Platform.FirebaseHandler:Update()
09-05 17:44:00.666 27511 27607 I Unity   :
09-05 17:44:00.673 27511 27607 I Unity   :  [Play Games Plugin 0.10.12] 09.05.21 17:44:00 +03:00 DEBUG: Activating PlayGamesPlatform.
09-05 17:44:00.673 27511 27607 I Unity   : System.Action:Invoke()
09-05 17:44:00.673 27511 27607 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
09-05 17:44:00.673 27511 27607 I Unity   :
09-05 17:44:00.674 27511 27607 I Unity   :  [Play Games Plugin 0.10.12] 09.05.21 17:44:00 +03:00 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
09-05 17:44:00.674 27511 27607 I Unity   : System.Action:Invoke()
09-05 17:44:00.674 27511 27607 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
09-05 17:44:00.674 27511 27607 I Unity   :
09-05 17:44:00.674 27511 27607 I Unity   :  [Play Games Plugin 0.10.12] 09.05.21 17:44:00 +03:00 DEBUG: Creating platform-specific Play Games client.
09-05 17:44:00.674 27511 27607 I Unity   : System.Action:Invoke()
09-05 17:44:00.674 27511 27607 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
09-05 17:44:00.674 27511 27607 I Unity   :
09-05 17:44:00.675 27511 27607 I Unity   :  [Play Games Plugin 0.10.12] 09.05.21 17:44:00 +03:00 DEBUG: Creating Android IPlayGamesClient Client
09-05 17:44:00.675 27511 27607 I Unity   : System.Action:Invoke()
09-05 17:44:00.675 27511 27607 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
09-05 17:44:00.675 27511 27607 I Unity   :
09-05 17:44:00.803 27511 27511 I Unity   : WRITE_EXTERNAL_STORAGE permission grant refused
09-05 17:44:00.803 27511 27511 I Unity   : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
09-05 17:44:00.803 27511 27511 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
09-05 17:44:00.803 27511 27511 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
09-05 17:44:00.803 27511 27511 I Unity   :
09-05 17:44:01.328 27511 27511 I Unity   : Returning an error code.
09-05 17:44:01.328 27511 27511 I Unity   : GooglePlayGames.Android.<>c__DisplayClass18_0:<Authenticate>b__0(Int32)
09-05 17:44:01.328 27511 27511 I Unity   : System.Action`1:Invoke(T)
09-05 17:44:01.328 27511 27511 I Unity   : System.Action`1:Invoke(T)
09-05 17:44:01.328 27511 27511 I Unity   : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
09-05 17:44:01.328 27511 27511 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
09-05 17:44:01.328 27511 27511 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
09-05 17:44:01.328 27511 27511 I Unity   :
09-05 17:44:01.336 27511 27607 I Unity   : login fail
09-05 17:44:01.336 27511 27607 I Unity   : System.Action`1:Invoke(T)
09-05 17:44:01.336 27511 27607 I Unity   : System.Action`2:Invoke(T1, T2)
09-05 17:44:01.336 27511 27607 I Unity   : GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)
09-05 17:44:01.336 27511 27607 I Unity   : System.Action`1:Invoke(T)
09-05 17:44:01.336 27511 27607 I Unity   : System.Action`1:Invoke(T)
09-05 17:44:01.336 27511 27607 I Unity   : System.Action:Invoke()
09-05 17:44:01.336 27511 27607 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
09-05 17:44:01.336 27511 27607 I Unity   :
09-05 17:44:01.353 27511 27607 I Unity   :  [Play Games Plugin 0.10.12] 09.05.21 17:44:01 +03:00 DEBUG: Authentication failed - developer error
09-05 17:44:01.353 27511 27607 I Unity   : System.Action:Invoke()
09-05 17:44:01.353 27511 27607 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
09-05 17:44:01.353 27511 27607 I Unity   :
09-05 17:44:03.836 27511 27511 I Unity   : Video loaded
09-05 17:44:03.836 27511 27511 I Unity   : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
09-05 17:44:03.836 27511 27511 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
09-05 17:44:03.836 27511 27511 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)


В то время как с этим кодом всё работает как надо
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
        .Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate(success =>
        {
            if (success)
            {
                string authCode = PlayGamesPlatform.Instance.GetServerAuthCode();
                Debug.Log("Authcode - " + authCode);
                FirebaseAuth(authCode);
            }
            else
            {
                Debug.Log("login fail");
            }
        });
  • Вопрос задан
  • 229 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы