1

I'm looking for a way to determine if the user has, via settings, enabled or disabled their Local notifications for my application. Here I'm not using push notification

Thanks.

akshata
  • 41
  • 3
  • 2
    @akshata Please accept if you have really got answers for your previous questions. Otherwise your chances of getting answers is less. – RK- Dec 28 '11 at 15:19

3 Answers3

0

Before iOS5.0 Local Notifications was always available.

Since iOS8.0 exists way to detect it is disabled by user or not: https://stackoverflow.com/a/26052687/751932

There are no public way to determine what you ask between iOS 5.0 to 8.0

Community
  • 1
  • 1
Maxim Kholyavkin
  • 4,463
  • 2
  • 37
  • 82
0

Set a test notification with a fireDate in 1 second. Check if it gets called in

(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification)
Rob van den Berg
  • 800
  • 5
  • 21
  • 1
    This test doesn't help. If the user has disabled local notifications for the app in settings, they will still be delivered while the app is open. – Confused Vorlon Sep 05 '14 at 13:11
  • 1
    Now 2 years later look at this better solution: http://stackoverflow.com/questions/26051950/check-if-local-notifications-are-enabled-in-ios-8/26052687#26052687 – Rob van den Berg Sep 27 '14 at 08:45
-2

you can find out what types of notifications the user has registered for by calling:

  [[UIApplication sharedApplication] enabledRemoteNotificationTypes];

which returns a bitmask based on UIRemoteNotificationType;

Mike K
  • 2,227
  • 1
  • 12
  • 6
  • this doesn't tell you if user has notification enabled at all, only what types he enabled. He could turn off notifications completely and this will still return 6 (in my case). Is there any way how to detect it more reliable? – Lope Jan 24 '12 at 13:32
  • Also, more importantly, enabledRemoteNotificationTypes tells you about the **remote** notification types that are enabled. @akshata was asking about **local** notifications. Unfortunately, there's no method in the UIApplication API that can show what local notifications are enabled. – yuji Feb 02 '12 at 19:14