From 88fd3bcd2731a4013064261f7049aa2752d6e051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fco=2E=20Javier=20Mart=C3=ADn=20Carrasco?= Date: Tue, 5 May 2015 22:49:11 +0200 Subject: [PATCH 1/2] Update PushPlugin.m Fix: enabledRemoteNotificationTypes is not supported in iOS 8.0 and later. --- src/ios/PushPlugin.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ios/PushPlugin.m b/src/ios/PushPlugin.m index 7686ae9d..1c953510 100644 --- a/src/ios/PushPlugin.m +++ b/src/ios/PushPlugin.m @@ -156,7 +156,12 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [results setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"appVersion"]; // Check what Notifications the user has turned on. We registered for all three, but they may have manually disabled some or all of them. - NSUInteger rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; + NSUInteger rntypes; + if (!SYSTEM_VERSION_LESS_THAN(@"8.0")) { + rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; + }else{ + rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; + } // Set the defaults to disabled unless we find otherwise... NSString *pushBadge = @"disabled"; From e2681379c8052b8570514f0b231ec5d254209b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fco=2E=20Javier=20Mart=C3=ADn=20Carrasco?= Date: Tue, 5 May 2015 22:49:58 +0200 Subject: [PATCH 2/2] Update PushPlugin.m Fix: enabledRemoteNotificationTypes is not supported in iOS 8.0 and later. --- src/ios/PushPlugin.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ios/PushPlugin.m b/src/ios/PushPlugin.m index 1c953510..3ec9504b 100644 --- a/src/ios/PushPlugin.m +++ b/src/ios/PushPlugin.m @@ -25,6 +25,8 @@ #import "PushPlugin.h" +#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) + @implementation PushPlugin @synthesize notificationMessage;