From 906b16a83d5ab28dd1bb781bd0cc94469d236037 Mon Sep 17 00:00:00 2001 From: Zachary Rote Date: Fri, 13 Oct 2017 16:03:43 -0400 Subject: [PATCH 1/2] handle case wher FIRApp is already configured --- src/ios/AppDelegate+FCMPlugin.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ios/AppDelegate+FCMPlugin.m b/src/ios/AppDelegate+FCMPlugin.m index 4261b1604..09457c5ca 100644 --- a/src/ios/AppDelegate+FCMPlugin.m +++ b/src/ios/AppDelegate+FCMPlugin.m @@ -95,7 +95,9 @@ - (BOOL)application:(UIApplication *)application customDidFinishLaunchingWithOpt } // [START configure_firebase] - [FIRApp configure]; + if([FIRApp defaultApp] == nil) + [FIRApp configure]; + // [END configure_firebase] // Add observer for InstanceID token refresh callback. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tokenRefreshNotification:) From 019201bf28c14a15e57af0bf328ae8e590310813 Mon Sep 17 00:00:00 2001 From: Zachary Rote Date: Sun, 15 Oct 2017 06:51:09 -0400 Subject: [PATCH 2/2] removed unused variable in didReceiveRemoteNotification --- src/ios/AppDelegate+FCMPlugin.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/AppDelegate+FCMPlugin.m b/src/ios/AppDelegate+FCMPlugin.m index 09457c5ca..204d016ca 100644 --- a/src/ios/AppDelegate+FCMPlugin.m +++ b/src/ios/AppDelegate+FCMPlugin.m @@ -225,8 +225,8 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N // foreground (user taps notification) UIApplicationState state = application.applicationState; - if (application.applicationState == UIApplicationStateActive - || application.applicationState == UIApplicationStateInactive) { + if (state == UIApplicationStateActive + || state == UIApplicationStateInactive) { [userInfoMutable setValue:@(NO) forKey:@"wasTapped"]; NSLog(@"app active"); NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfoMutable