I am not sure if this is a weird bug, but in my
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
I have the following lines of code to ask for user permissions:
// Register for Push Notitications, if running iOS 8
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
} else {
// Register for Push Notifications before iOS 8
[application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeAlert |
UIRemoteNotificationTypeSound)];
}
On the simulator, everything works fine, but on my iPhone, when I install the app, it does not ask for these permissions. I have initiated breakpoints to make sure the lines execute and they do.
When I go into Settings > Notifications > My App
the notifications are on, so it seems that the system knows I have granted permission before, so it doesn't ask, but that seems weird.
Has anyone seen this before?