How to disallow UILocalNotifications?

64 views Asked by At

I want to disable local notifications within an app - similar to what a user would do in the Settings app

Here is what I tried:

  UIApplication.sharedApplication().cancelAllLocalNotifications()
  UIApplication.sharedApplication().registerUserNotificationSettings(UIUser NotificationSettings(forTypes: .None, categories: nil))

That did not work. Is there another way?

Cheers

EDIT

The customer want's such a switch in the App. It should disable/enable local notifications. If the switch is off the App will not create any local notifications. However, there is an inconsistency: the switch in the App is off, the switch in the Settings App is still on. That may be confusing. And again - it's the kings wish to have such a switch - so I have to obey.

0

There are 0 answers