My app needs to be set in iOS 5 Notification Center as 'alerts' and with 'sounds' on. From what I have found it is not possible for your app to offer setting these correctly, which would be the best option so correct me if im wrong.
So, I am looking for a procedure to detect the current settings and warn the user if these are not correct.
actually it can be done with the following method -
UIRemoteNotificationType types = [UIApplicationsharedApplication].enabledRemoteNotificationTypes;
while types is
typedef enum
{
UIRemoteNotificationTypeNone = 0,
UIRemoteNotificationTypeBadge = 1 << 0,
UIRemoteNotificationTypeSound = 1 << 1,
UIRemoteNotificationTypeAlert = 1 << 2,
UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3
}
according to:
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html
So if you want to know if the user approved your app for notifications, all you need to do is to check whether types >= 4
be aware: this will not tell you if the user has enabled or disabled notification center for your app, it will only tell you the TYPE of the notification that the user approved
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With