I want to make a game that tests out local notifications. In iOS 8, the code involves these steps:
- Make a
UIMutableUserNotificationCategoryobject that is the category of custom actions you want to implement. - Make up to 4 custom actions by using
UIMutableUserNotificationActioninstances. - Call
setActions:forContext:to set up custom actions. - Make a
UIUserNotificationSettingsobject and callsettingsForTypes:categories:on it. - Register the application's user notification settings by calling
registerUserNotificationSettings:on the sharedUIApplicationinstance.
My question is, for the UIUserNotificationSettings mentioned in Step 4, how would you register an application for more that one category? The values that can be set for it are:
UIUserNotificationTypeAlert(show just the alert)UIUserNotificationTypeBadge(show just a badge)UIUserNotificationTypeSound(only play a sound)UIUserNotificationTypeNone(do nothing)
It sounds like an application should be easily able to show an alert, display a badge, and display a sound. However, before the notification fires, it has to be registered for all of the three. The parameter takes an NSUInteger.
My question is, how would one make it so it had access to all three of the permissions? You can't pass an NSArray to it, so there should be another way I'm not seeing...