diff --git a/src/Auth.Google/Platforms/iOS/FirebaseAuthGoogleImplementation.cs b/src/Auth.Google/Platforms/iOS/FirebaseAuthGoogleImplementation.cs index 7532c22..765dfa2 100644 --- a/src/Auth.Google/Platforms/iOS/FirebaseAuthGoogleImplementation.cs +++ b/src/Auth.Google/Platforms/iOS/FirebaseAuthGoogleImplementation.cs @@ -16,12 +16,12 @@ public static void Initialize() var clientId = googleServiceDictionary["CLIENT_ID"].ToString(); SignIn.SharedInstance.Configuration = new Configuration(clientId); } - + public static bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options) { return SignIn.SharedInstance.HandleUrl(url); } - + private readonly FirebaseAuth _firebaseAuth; private static Lazy _googleAuth; @@ -30,7 +30,7 @@ public FirebaseAuthGoogleImplementation() _firebaseAuth = FirebaseAuth.DefaultInstance; _googleAuth = new Lazy(() => new GoogleAuth()); } - + public async Task SignInWithGoogleAsync() { try { @@ -40,13 +40,13 @@ public async Task SignInWithGoogleAsync() throw GetFirebaseAuthException(e); } } - + private async Task SignInWithCredentialAsync(AuthCredential credential) { var authResult = await _firebaseAuth.SignInWithCredentialAsync(credential); return authResult.User.ToAbstract(authResult.AdditionalUserInfo); } - + private static FirebaseAuthException GetFirebaseAuthException(NSErrorException ex) { AuthErrorCode errorCode; @@ -59,7 +59,7 @@ private static FirebaseAuthException GetFirebaseAuthException(NSErrorException e Enum.TryParse(errorCode.ToString(), out FIRAuthError authError); return new FirebaseAuthException(authError, ex.Error.LocalizedDescription); } - + public async Task LinkWithGoogleAsync() { try { @@ -70,19 +70,19 @@ public async Task LinkWithGoogleAsync() throw GetFirebaseAuthException(e); } } - + private async Task LinkWithCredentialAsync(AuthCredential credential) { var authResult = await _firebaseAuth.CurrentUser.LinkAsync(credential); return authResult.User.ToAbstract(authResult.AdditionalUserInfo); } - + public Task SignOutAsync() { _googleAuth.Value.SignOut(); return Task.CompletedTask; } - + private static UIViewController ViewController { get { var rootViewController = UIApplication.SharedApplication.KeyWindow.RootViewController;