[英]Firebase Unity SDK Auth using Facebook Token
I am using the Firebase SDK for Unity. 我正在使用Firebase SDK for Unity。 I am trying to do Firebase auth using Facebook credentials but I am getting the below error on Android.
我正在尝试使用Facebook凭据进行Firebase身份验证,但在Android上出现以下错误。 Everything looks configured properly in the Firebase Console.
在Firebase控制台中,一切看上去都已正确配置。 I have enabled Facebook as a Sign-In-Method and added the OAuth redirect URL to my Facebook app configuration.
我已将Facebook作为登录方法启用,并将OAuth重定向URL添加到了我的Facebook应用程序配置中。 Thank you for any help.
感谢您的任何帮助。
private void AuthFirebaseFacebook(string token) {
Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
Firebase.Auth.Credential credential =
Firebase.Auth.FacebookAuthProvider.GetCredential(token);
auth.SignInWithCredentialAsync(credential).ContinueWith(task => {
if (task.IsCanceled)
{
AtagDebug.Log("SignInWithCredentialAsync was canceled.");
return;
}
if (task.IsFaulted)
{
AtagDebug.Log("SignInWithCredentialAsync encountered an error: " + task.Exception);
return;
}
Firebase.Auth.FirebaseUser newUser = task.Result;
AtagDebug.Log("User signed in successfully: " +
newUser.DisplayName + " " + newUser.UserId);
});
}
SignInWithCredentialAsync encountered an error:
System.AggregateException: Exception of type 'System.AggregateException' was thrown.
Firebase.FirebaseException: An internal error has occurred. [ Access Not Configured. Google Identity Toolkit API has not been used in project 98824003602 before or it is disabled. Enable it by visiting https ]
The problem was I had an outdated google-services.json in one of my Android Plugins. 问题是我的一个Android插件中有一个过时的google-services.json。 Note to self and others: Be sure to update the google-services.json not only in Unity, but any plugins or external code you are using that gets built into the app.
自我和其他人的注意事项:确保不仅在Unity中更新google-services.json,而且还要更新应用程序中内置的所有正在使用的插件或外部代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.