Description
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2020.2.7f1
- Firebase Unity SDK version: 8.7.0
- Source you installed the SDK: unitypackage (.unitypackage or Unity Package Manager)
- Problematic Firebase Component: Auth (Auth, Database, etc.)
- Other Firebase Components in use: _____ (Auth, Database, etc.)
- Additional SDKs you are using: _____ (Facebook, AdMob, etc.)
- Platform you are using the Unity editor on: Windows (Mac, Windows, or Linux)
- Platform you are targeting: Android (iOS, Android, and/or desktop)
- Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)
[REQUIRED] Please describe the issue here:
I use this example to log in apple id on Android.
Firebase.Auth.FederatedOAuthProviderData providerData =new Firebase.Auth.FederatedOAuthProviderData();
providerData.ProviderId = "apple.com";
providerData.Scopes = new List();
providerData.Scopes.Add("email");
providerData.Scopes.Add("name");
Firebase.Auth.FederatedOAuthProvider provider =
new Firebase.Auth.FederatedOAuthProvider();
provider.SetProviderData(providerData);
auth.SignInWithProviderAsync(provider).ContinueOnMainThread(task => {
if (task.IsCanceled) {
Debug.LogError("SignInWithProviderAsync was canceled.");
return;
}
if (task.IsFaulted) {
Debug.LogError("SignInWithProviderAsync encountered an error: " +
task.Exception);
return;
}
Firebase.Auth.SignInResult signInResult = task.Result;
Firebase.Auth.FirebaseUser user = signInResult.User;
Debug.LogFormat("User signed in successfully: {0} ({1})",
user.DisplayName, user.UserId);
});
Everything works fine on Android. But when I pull up the authorization page and click the home button, I go back to my game from the desktop.Then when I call SignInWithProviderAsync again in the same way, I get an error :
SignInWithProviderAsync encountered an error: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: A headful operation is already in progress. Please wait for that to finish.
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: A headful operation is already in progress. Please wait for that to finish.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Firebase.FirebaseException: A headful operation is already in progress. Please wait for that to finish.<---
<---
UnityEngine.Logger:Log(LogType, Object)
MobileLoginService:b__13_0(Task1) System.Action
1:Invoke(T)
Firebase.Extensions.c__AnonStorey9:<>m__0()
System.Func1:Invoke() Firebase.<RunAsync>c__AnonStorey1
1:<>m__0()
System.Action:Invoke()
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Steps to reproduce:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Yes.
What's the issue repro rate? (eg 100%, 1/5 etc) 100%
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
-
Download and configure this github project to make it run
-
Modify the SignInWithProvider function:
protected void SignInWithProvider(string providerId) {
var providerData = new Firebase.Auth.FederatedOAuthProviderData();
providerData.ProviderId = "apple.com";
providerData.Scopes = new List() { "name", "email" };var provider = new Firebase.Auth.FederatedOAuthProvider(); provider.SetProviderData(providerData); auth.SignInWithProviderAsync(provider).ContinueWithOnMainThread(signin_task => { if (LogTaskCompletion(signin_task, "SignInWithProvider")) { DebugLog("SignInWithProviderTask Completed:" + signin_task.IsCompleted); } if(signin_task.Exception != null) { DebugLog("SignInWithProviderTask - Exception: " + signin_task.Exception.Message); return; } DisplaySignInResult(signin_task.Result, 1);
});
} -
Click SignInWith | Miscrosoft, open the browser and click the home button to return to the Android desktop, click app to return to the application, and click SignInWith | Miscrosoft again.
If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.
Relevant Code:
// TODO(you): code here to reproduce the problem