0

How to detect local(not push notification) notifications are allowed or not ? I'm going to integrate local notifications with my app, and for app functionality is very important to detect are local notifications allowed or not.

taffarel
  • 4,015
  • 4
  • 33
  • 61

3 Answers3

1

As I know user can not disable local notification. So, you do not need to check availability of them.

Sergey Demchenko
  • 2,924
  • 1
  • 24
  • 26
1

Local notifications are always allowed and are available as any other functionality in iOS SDK. Push notifications, however, require special signature for the app to work. Read more about that in Developer docs.

If your app is frontmost and requires to respond to local notification, just implement method application:didReceiveLocalNotification: If it's not, then implement functionality, that is described in Apple Developer docs in method application:didFinishLaunchingWithOptions:

Nayan
  • 3,014
  • 2
  • 17
  • 33
mbpro
  • 2,460
  • 3
  • 22
  • 37
  • if user disable local notification in the settings then app can handle notification only with `application:didReceiveLocalNotification:` (while frontmost) and never receive `application:didFinishLaunchingWithOptions:` – Maxim Kholyavkin Nov 01 '14 at 00:27
-1

Use CLLocationManager Delegate if user not allow location service the delegate call:

- (void)locationManager:(CLLocationManager *)manager
   didFailWithError:(NSError *)error;

And when the notification service allow you can use local notification whit this function:

- (void)startMonitoringForRegion:(CLRegion *)region
             desiredAccuracy:(CLLocationAccuracy)accuracy __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA,__IPHONE_4_0, __IPHONE_6_0);
larva
  • 4,687
  • 1
  • 24
  • 44