|
@@ -152,24 +152,11 @@
|
|
|
NSLog(@"[LOG] Something went wrong while configuring Firebase");
|
|
|
}
|
|
|
|
|
|
- if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max) {
|
|
|
-
|
|
|
- UIUserNotificationType allNotificationTypes =(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
|
|
|
- UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
|
|
|
-
|
|
|
- [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- // iOS 10 or later
|
|
|
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
|
- // For iOS 10 display notification (sent via APNS)
|
|
|
- [UNUserNotificationCenter currentNotificationCenter].delegate = self;
|
|
|
- UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
|
|
|
- [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
|
|
- }];
|
|
|
-#endif
|
|
|
- }
|
|
|
+ // Display notification (sent via APNS)
|
|
|
+ [UNUserNotificationCenter currentNotificationCenter].delegate = self;
|
|
|
+ UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
|
|
|
+ [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
|
|
+ }];
|
|
|
|
|
|
[application registerForRemoteNotifications];
|
|
|
[FIRMessaging messaging].delegate = self;
|