Commit 24354dce by Timothy Williams

correctly check ios version

parent f82b9d32
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
*/ */
- (void) promptForPermission:(CDVInvokedUrlCommand *)command - (void) promptForPermission:(CDVInvokedUrlCommand *)command
{ {
#ifdef __IPHONE_8_0 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
UIUserNotificationType types = UIUserNotificationType types =
UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound; UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound;
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
[[UIApplication sharedApplication] [[UIApplication sharedApplication]
registerUserNotificationSettings:settings]; registerUserNotificationSettings:settings];
}]; }];
#endif }
} }
/** /**
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
*/ */
- (BOOL) hasPermissionToSheduleNotifications - (BOOL) hasPermissionToSheduleNotifications
{ {
#ifdef __IPHONE_8_0 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
UIUserNotificationSettings *settings = [[UIApplication sharedApplication] UIUserNotificationSettings *settings = [[UIApplication sharedApplication]
currentUserNotificationSettings]; currentUserNotificationSettings];
...@@ -265,9 +265,9 @@ ...@@ -265,9 +265,9 @@
UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound; UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound;
return (settings.types & requiredTypes); return (settings.types & requiredTypes);
#else } else {
return YES; return YES;
#endif }
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment