Commit 855f1aba authored by Simon MacDonald's avatar Simon MacDonald
Browse files

Issue #8: Update code using enabledRemoteNotificationTypes because it is 'not supported in iOS 8'

parent bef8e28a
Loading
Loading
Loading
Loading
+8 −1
Changes for src/ios/PushPlugin.m: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -125,7 +125,14 @@
        [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];
        #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
    
        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";