objective c - iOS Notification Center Registration -
i want make game tests out local notifications. in ios 8, code involves these steps:
- make
uimutableusernotificationcategory
object category of custom actions want implement. - make 4 custom actions using
uimutableusernotificationaction
instances. - call
setactions:forcontext:
set custom actions. - make
uiusernotificationsettings
object , callsettingsfortypes:categories:
on it. - register application's user notification settings calling
registerusernotificationsettings:
on shareduiapplication
instance.
my question is, uiusernotificationsettings
mentioned in step 4, how register application more 1 category? values can set are:
uiusernotificationtypealert
(show alert)uiusernotificationtypebadge
(show badge)uiusernotificationtypesound
(only play sound)uiusernotificationtypenone
(do nothing)
it sounds application should able show alert, display badge, , display sound. however, before notification fires, has registered of three. parameter takes nsuinteger
.
my question is, how 1 make had access 3 of permissions? can't pass nsarray
it, there should way i'm not seeing...
take example:
[[uiapplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsfortypes:(uiusernotificationtypesound | uiusernotificationtypealert | uiusernotificationtypebadge) categories:nil]]; [[uiapplication sharedapplication] registerforremotenotifications];
Comments
Post a Comment