@@ -55,6 +55,12 @@ + (void) setFirestore:(FIRFirestore*) firestoreInstance{
5555 firestore = firestoreInstance;
5656}
5757
58+ - (void )applicationLaunchedWithUrl : (NSNotification *)notification
59+ {
60+ NSURL * url = [notification object ];
61+ [[GIDSignIn sharedInstance ] handleURL: url];
62+ }
63+
5864// @override abstract
5965- (void )pluginInitialize {
6066 NSLog (@" Starting Firebase plugin" );
@@ -64,6 +70,8 @@ - (void)pluginInitialize {
6470 preferences = [NSUserDefaults standardUserDefaults ];
6571 googlePlist = [NSMutableDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle ] pathForResource: @" GoogleService-Info" ofType: @" plist" ]];
6672
73+ [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (applicationLaunchedWithUrl: ) name: CDVPluginHandleOpenURLNotification object: nil ];
74+
6775 if ([self getGooglePlistFlagWithDefaultValue: FirebaseCrashlyticsCollectionEnabled defaultValue: YES ]){
6876 [self setPreferenceFlag: FIREBASE_CRASHLYTICS_COLLECTION_ENABLED flag: YES ];
6977 }
@@ -81,7 +89,7 @@ - (void)pluginInitialize {
8189
8290 // Check for permission and register for remote notifications if granted
8391 [self _hasPermission: ^(BOOL result) {}];
84-
92+
8593
8694 authCredentials = [[NSMutableDictionary alloc ] init ];
8795 firestoreListeners = [[NSMutableDictionary alloc ] init ];
@@ -738,15 +746,15 @@ - (void)authenticateUserWithGoogle:(CDVInvokedUrlCommand*)command{
738746 [GIDSignIn.sharedInstance signInWithConfiguration: googleSignInConfig presentingViewController: self .viewController callback: ^(GIDGoogleUser * _Nullable user, NSError * _Nullable error) {
739747 __auto_type strongSelf = weakSelf;
740748 if (strongSelf == nil ) { return ; }
741-
749+
742750 @try {
743751 CDVPluginResult* pluginResult;
744752 if (error == nil ) {
745753 GIDAuthentication *authentication = user.authentication ;
746754 FIRAuthCredential *credential =
747755 [FIRGoogleAuthProvider credentialWithIDToken: authentication.idToken
748756 accessToken: authentication.accessToken];
749-
757+
750758 NSNumber * key = [[FirebasePlugin firebasePlugin ] saveAuthCredential: credential];
751759 NSString *idToken = user.authentication .idToken ;
752760 NSMutableDictionary * result = [[NSMutableDictionary alloc ] init ];
0 commit comments