@@ -196,6 +196,7 @@ void NotifyListenerSet(Listener* listener) {
196
196
LogInfo (" FCM: Using FCM senderID %s" , senderID.UTF8String );
197
197
id appDelegate = [UIApplication sharedApplication ];
198
198
199
+ #if FIREBASE_PLATFORM_IOS
199
200
// Register for remote notifications. Both codepaths result in
200
201
// application:didRegisterForRemoteNotificationsWithDeviceToken: being called when they
201
202
// complete, or application:didFailToRegisterForRemoteNotificationsWithError: if there was an
@@ -215,6 +216,7 @@ void NotifyListenerSet(Listener* listener) {
215
216
[appDelegate registerUserNotificationSettings: settings];
216
217
[appDelegate registerForRemoteNotifications ];
217
218
}
219
+ #endif // FIREBASE_PLATFORM_IOS
218
220
219
221
// Only request the token automatically if permitted
220
222
if ([FIRMessaging messaging ].autoInitEnabled ) {
@@ -522,6 +524,7 @@ static BOOL AppDelegateApplicationDidFinishLaunchingWithOptions(id self, SEL sel
522
524
[user_notification_center setDelegate: (id <UNUserNotificationCenterDelegate >)application];
523
525
}
524
526
527
+ #if FIREBASE_PLATFORM_IOS
525
528
// If the app was launched with a notification, cache it until we're connected.
526
529
g_launch_notification =
527
530
[launch_options objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
@@ -548,6 +551,7 @@ static BOOL AppDelegateApplicationDidFinishLaunchingWithOptions(id self, SEL sel
548
551
[invocation getReturnValue: &ret];
549
552
return ret;
550
553
}
554
+ #endif // FIREBASE_PLATFORM_IOS
551
555
return NO ;
552
556
}
553
557
@@ -854,6 +858,7 @@ + (void)load {
854
858
});
855
859
}
856
860
861
+ #if FIREBASE_PLATFORM_IOS
857
862
- (void )userNotificationCenter : (UNUserNotificationCenter *)notificationCenter
858
863
willPresentNotification : (UNNotification *)notification
859
864
withCompletionHandler :
@@ -890,6 +895,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)notificationCenter
890
895
withCompletionHandler: completionHandler];
891
896
}
892
897
}
898
+ #endif // FIREBASE_PLATFORM_IOS
893
899
894
900
@end
895
901
0 commit comments