Capturing the response to the message "The application wants to send you notifications about push notifications"

The first time registerForRemoteNotificationTypes:you call your site UIApplication, a message appears a UIAlertViewthat says: "[application] wants to send you push notifications."

Is there any way to find out when in this AlertView?

use "OK" or "Do not allow"

Currently application:didRegisterForRemoteNotificationsWithDeviceToken:called on mine AppDelegate, even before the user makes a decision.

I ask, because at the first start I want to click ViewControllerwith the parameters Notification, but only if the user has indicated that they want to receive notifications.

+5
source share
1 answer

You can use the following method UIApplication:

Returns the types of notifications that the application accepts.

- (UIRemoteNotificationType)enabledRemoteNotificationTypes

For instance,

UIRemoteNotificationType status = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (status == UIRemoteNotificationTypeNone)
{
     NSLog(@"user is not subscribed to receive push notifications");
}
+3
source

All Articles