From 9cd0c08d00e8d9b1af86c06bf7c6f2d1ec3e7e00 Mon Sep 17 00:00:00 2001 From: Dave Alden Date: Sun, 5 Apr 2020 22:04:46 +0100 Subject: [PATCH] [iOS] Sign out of Google when signing out of Firebase. Resolves #353. --- CHANGELOG.md | 1 + src/ios/FirebasePlugin.m | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 168f3bcd2..dd5671c5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ * (Android): Don't display app icon for large notification icon on Android. Resolves [#343](https://github.com/dpa99c/cordova-plugin-firebasex/issues/343). +* (Android & iOS) Sign out of Google signing out of Firebase. Resolves [#353](https://github.com/dpa99c/cordova-plugin-firebasex/issues/353). # Version 9.0.1 * Re-add Firebase Inapp Messaging SDK component to master branch. diff --git a/src/ios/FirebasePlugin.m b/src/ios/FirebasePlugin.m index dc92835c5..818ee7402 100644 --- a/src/ios/FirebasePlugin.m +++ b/src/ios/FirebasePlugin.m @@ -656,6 +656,13 @@ - (void)signOutUser:(CDVInvokedUrlCommand*)command { [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No user is currently signed"] callbackId:command.callbackId]; return; } + + // Sign out of Google + if([[GIDSignIn sharedInstance] currentUser] != nil){ + [[GIDSignIn sharedInstance] signOut]; + } + + // Sign out of Firebase NSError *signOutError; BOOL status = [[FIRAuth auth] signOut:&signOutError]; if (!status) {