Search code examples
objective-cios8uilocalnotification

Calling registerUserNotificationSettings multiple times


I am developing an app for iOS 8 and utilizing interactive notifications. For that one has to register notification settings with categories. Problem is I have to schedule local notification at different point of my app based on user inputs. So the question is if call this code

UIUserNotificationSettings *mySettings =
[UIUserNotificationSettings settingsForTypes:types categories:[NSSet setWithObject:myCategary]];

[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];

multiple times with different "myCategories" will it overwrite my existing categories or add to previous registered for local notifications?


Solution

  • It will overwrite the old settings as UIUserNotificationSettings is singleton. Find more explanation here: ios 8 interactive notifications not showing actions