Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS5: how to determine if the Notification Center for the app is turned ON/OFF

I want to respect my users' intent and not call [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(...)] if they've turned off remote notifications for my app.

When calling UIRemoteNotificationType enabledTypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes], I get the info on what types of notifications are enabled for my app. However, the Notification Center for this app can be turned OFF and I still get the previously enabled notification type from this method until I select "None".

Thus my app thinks notifications are enabled even when they aren't.

Is there a way to programatically find out the Notification Center status for my app? (ON/OFF).

like image 995
Tomas Kohl Avatar asked Nov 12 '11 14:11

Tomas Kohl


1 Answers

Don't confuse "in the notification center" with "push notifications enabled." I can remove an app from the notification center but still have it receiving push notifications in the form of badge numbers, so your old method should work fine.

like image 87
Ash Furrow Avatar answered Sep 22 '22 11:09

Ash Furrow