Skip to content

Instantly share code, notes, and snippets.

@didats
Created January 31, 2015 18:39
Show Gist options
  • Select an option

  • Save didats/bf6e773c6f293461b8e6 to your computer and use it in GitHub Desktop.

Select an option

Save didats/bf6e773c6f293461b8e6 to your computer and use it in GitHub Desktop.

Revisions

  1. didats created this gist Jan 31, 2015.
    8 changes: 8 additions & 0 deletions check-notification-status.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    NSInteger activePush = 1;
    if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) {
    activePush = ([application isRegisteredForRemoteNotifications]) ? 1 : 0;
    }
    else {
    UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
    if (types == UIRemoteNotificationTypeNone) activePush = 0;
    }