Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

"SignInWithCredential" Not giving any return, App got stuck after calling SignInWithCredential. #337

Closed
remeesms opened this issue Nov 14, 2019 · 3 comments

Comments

@remeesms
Copy link

As soon as I call SignInWithCredential in the app the app got stuck, there is no return coming from SignInWithCredential. The code sample and Firebase versions I am using given below.

Firebase versions using:

<package id="Xamarin.Firebase.iOS.Analytics" version="5.1.4.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Auth" version="6.2.1.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.CloudMessaging" version="4.1.1.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Core" version="6.1.0" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Database" version="6.0.0" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.InstanceID" version="4.2.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Storage" version="3.4.0" targetFramework="xamarinios10" /> 

Implementation:

var credendtials = PhoneAuthProvider.DefaultInstance.GetCredential(verificationId, verificationCode);
Auth.DefaultInstance.SignInWithCredential(credential: credendtials, (task, error) =>
            {
                if (error != null)
                {                  
                    tcsPhone.SetResult(false);
                }
                else
                {
                    tcsPhone.SetResult(true);
                }

            });

There is no error nothing, the code flow not continuing after "Auth.DefaultInstance.SignInWithCredential"

@SotoiGhost
Copy link
Contributor

@remeesms I have just tested our auth sample and everything seems to be working correctly. Can you try deleting your app from your phone/simulator, delete bin and obj folders and try again, please? Maybe some cache files got corrupted after updating the NuGet and it's messing with the debugger and with the app flow. This can happen rarely but it happens sometimes. I have faced that before.

If that does not work, can you provide a test case? Thanks in advance!

@remeesms
Copy link
Author

Thanks, I will try it and update here.

@remeesms
Copy link
Author

@SotoiGhost Yeah it's working after removing the cache and bin & obj. But the "SignInWithCredentialAsync" is working instead of "SignInWithCredential". Thanks for the support.

await Auth.DefaultInstance.SignInWithCredentialAsync(credendtials).ContinueWith(task =>
            {

                Core.Logging.Log.Debug("SignInWithCredentialAsync Working", "inside");

                if (task.IsFaulted)
                {
                    tcsPhone.SetResult(false);
                    Core.Logging.Log.Debug("SignInWithCredentialAsync encountered an error: ",
                                    tcsPhone.Task.Result.ToString());

                }
                else
                {
                    tcsPhone.SetResult(true);
                    Core.Logging.Log.Debug("SignInByPhone Working", tcsPhone.Task.Result.ToString());
                }
            });

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

No branches or pull requests

2 participants