how to check app's push notification status is on or off?

Discussion in 'iOS Programming' started by Narendar Singh, Apr 8, 2013.

  1. Narendar Singh macrumors member

    Narendar Singh

    Joined:
    Jun 22, 2012
    Location:
    INDIA
    #1
    Hi,

    I have an application. There can be two possible condition for the app.
    1. Push notification is on
    2. Push notification is off

    we can see above two status from the Settings.

    Can we detect programatically whether the push notification is on or off particular for this app.
     
  2. truehybridx macrumors member

    Joined:
    Dec 6, 2010
    #2
    Not sure if this still works, but found it on SO

    Code:
    UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
    
    if (types == UIRemoteNotificationTypeNone) {
         // No Notifications
    } else {
         // Has Notifications
    }
    
    Origin http://stackoverflow.com/questions/9005889/how-to-check-that-notifications-are-enabled-on-iphone

    For more in depth into the notification types, section marked UIRemoteNotificationType
    http://developer.apple.com/library/.../UIApplication_Class/Reference/Reference.html
     
  3. Narendar Singh thread starter macrumors member

    Narendar Singh

    Joined:
    Jun 22, 2012
    Location:
    INDIA
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Too vague.
     

Share This Page