0
votes

My custom app uses push notifications, and I've rebuilt it and loaded it onto my iPad mini Retina, and iPhone 6s (both IOS 9.0.2). I've enabled notifications for the app in settings on both, and in Xcode I've checked that

a) the "Required Backgound Modes is set in plist so that App downloads content in response to push notifications.

b) Under Capabilities, Push Notifications is set on

c) Under Capabilities, Background Modes has Remote Notifications checked.

So the iPad gets push notifications but the iPhone doesn't. I've tried 3 new iPhones.

Ideas?

1

1 Answers

0
votes

Since iOS8 push registration is changed, if you never updated from iOS7 this will be the first time that you encounter this issue. The fact is that the old deprecated method will fail silently on iOS8 and 9.
Here is the snippet to register from < iOS8 and >= iOS8.

 if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
    {
        [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

    }
    else
    {
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
         (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
    }