Determine on iPhone if user has enabled push notifications

Kevin picture Kevin · Oct 8, 2009 · Viewed 122k times · Source

I'm looking for a way to determine if the user has, via settings, enabled or disabled their push notifications for my application.

Answer

Zac Bowling picture Zac Bowling · Oct 8, 2009

Call enabledRemoteNotificationsTypes and check the mask.

For example:

UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (types == UIRemoteNotificationTypeNone) 
   // blah blah blah

iOS8 and above:

[[UIApplication sharedApplication] isRegisteredForRemoteNotifications]