I saw this question but didn't understand if there is a clear answer.
I can tell if the user pressed "don't allow" on the SECOND launch of the app by setting a flag:
BOOL didRequest = [[NSUserDefaults standardUserDefaults] boolForKey:@"DidRequestPushNotifications"];
UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (types == UIRemoteNotificationTypeNone && didRequest)
{
[self showAlertToUserToEnableRemoteNotificationsOnDeviceInSettings];
}
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"DidRequestPushNotifications"];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
But for the first launch of the app - both delegate methods for success and failure aren't called and that means that there is no way to know for sure.
Any work around?