The first time you call registerForRemoteNotificationTypes: on your UIApplication object, a UIAlertView pops up saying "[app] would like to send you push notifications".
Is there any way to know when "OK" or "Don't allow" is tapped in this AlertView?
Currently application:didRegisterForRemoteNotificationsWithDeviceToken: is called on my AppDelegate, even before a user makes a decision.
The reason I ask is because on first launch, I want to push a ViewController with Notification options, but only if the user indicated that they want to receive notifications.
You can use next method of UIApplication:
Returns the types of notifications the application accepts.
- (UIRemoteNotificationType)enabledRemoteNotificationTypes
For example,
UIRemoteNotificationType status = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (status == UIRemoteNotificationTypeNone)
{
NSLog(@"user is not subscribed to receive push notifications");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With