@@ -196,6 +196,7 @@ void NotifyListenerSet(Listener* listener) {
196196 LogInfo (" FCM: Using FCM senderID %s" , senderID.UTF8String );
197197 id appDelegate = [UIApplication sharedApplication ];
198198
199+ #if FIREBASE_PLATFORM_IOS
199200 // Register for remote notifications. Both codepaths result in
200201 // application:didRegisterForRemoteNotificationsWithDeviceToken: being called when they
201202 // complete, or application:didFailToRegisterForRemoteNotificationsWithError: if there was an
@@ -215,6 +216,7 @@ void NotifyListenerSet(Listener* listener) {
215216 [appDelegate registerUserNotificationSettings: settings];
216217 [appDelegate registerForRemoteNotifications ];
217218 }
219+ #endif // FIREBASE_PLATFORM_IOS
218220
219221 // Only request the token automatically if permitted
220222 if ([FIRMessaging messaging ].autoInitEnabled ) {
@@ -522,6 +524,7 @@ static BOOL AppDelegateApplicationDidFinishLaunchingWithOptions(id self, SEL sel
522524 [user_notification_center setDelegate: (id <UNUserNotificationCenterDelegate >)application];
523525 }
524526
527+ #if FIREBASE_PLATFORM_IOS
525528 // If the app was launched with a notification, cache it until we're connected.
526529 g_launch_notification =
527530 [launch_options objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
@@ -548,6 +551,7 @@ static BOOL AppDelegateApplicationDidFinishLaunchingWithOptions(id self, SEL sel
548551 [invocation getReturnValue: &ret];
549552 return ret;
550553 }
554+ #endif // FIREBASE_PLATFORM_IOS
551555 return NO ;
552556}
553557
@@ -854,6 +858,7 @@ + (void)load {
854858 });
855859}
856860
861+ #if FIREBASE_PLATFORM_IOS
857862- (void )userNotificationCenter : (UNUserNotificationCenter *)notificationCenter
858863 willPresentNotification : (UNNotification *)notification
859864 withCompletionHandler :
@@ -890,6 +895,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)notificationCenter
890895 withCompletionHandler: completionHandler];
891896 }
892897}
898+ #endif // FIREBASE_PLATFORM_IOS
893899
894900@end
895901
0 commit comments