Check if APNS are enabled in your App
- (BOOL)isPushEnabled {
UIApplication *application = [UIApplication sharedApplication];
return application.enabledRemoteNotificationTypes != UIRemoteNotificationTypeNone;
}
Example:
NSLog(@"APNS are %@enabled.", [self isPushEnabled] ? @"" : @"not ");
Written by Gilo
Related protips
1 Response
Isn't it true that enabledRemoteNotificationTypes can be UIRemoteNotificationTypeNone but if Badge App Icon is ON you'll still get APNS messages? My testing seems to show that Alert Style can be none and it doesn't matter as long as Badge App Icon is ON.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#