Skip to content

Commit

Permalink
Temp changes to fix enabledRemoteNotificationTypes issue in iOS-8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Evernym committed Sep 4, 2015
1 parent bb3327b commit 130b7bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (void)isEnabled:(CDVInvokedUrlCommand*)command {
{
enabled = [application isRegisteredForRemoteNotifications];
} else {
UIRemoteNotificationType types = [application enabledRemoteNotificationTypes];
UIRemoteNotificationType types = [[application currentUserNotificationSettings] types];
enabled = types & UIRemoteNotificationTypeAlert;
}

Expand Down Expand Up @@ -179,7 +179,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";
Expand Down

0 comments on commit 130b7bf

Please sign in to comment.