Calling registerUserNotificationSettings multiple times

I am developing an iOS 8 app and use interactive notifications. To do this, you need to register notification settings using categories. The problem is that I have to schedule local notification at different points in my application based on user inputs. So the question is, if you 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 the previous ones registered for local notifications?

+3


source to share


2 answers


It will overwrite the old settings as it UIUserNotificationSettings

is one-point. More details here: ios 8 interactive notifications showing no activity



0


source


With the above code, you are asking for the user's permission to schedule a notification. (A popup where he can choose: do not allow or allow the app to send you a push notification) This popup is shown only once, no matter which user chooses. If the user selects "Do not allow", he can only change this setting in the "Settings" of the phone. However, once the user gives you permission to send notifications, you can schedule them from anywhere in the app.



0


source







All Articles