iOS SDK
Permission prompt
Ask for notification permission with one call. A grant registers for the push token.
Ask
Swift
Xulo.requestPushPermission { granted in
// true when the person allowed notifications
}
The system prompt asks for alerts, sounds and badges. The completion is true when the person allows notifications. A grant also registers for the push token, so the install becomes subscribed once Apple returns it.
The call without a completion works too:
Swift
Xulo.requestPushPermission()
When the prompt does not show
iOS shows the prompt once. If the person already allowed notifications, or your app holds provisional permission, Xulo.start registers for a token without asking again. If the person refused, the completion returns false.
Without push permission
An install that refused push is still an install:
- It still gets in-app cards. Cards do not go through Apple's push service.
- It still counts as a monthly active user when it opens the app.
- It is not in the Subscribed audience and does not receive a push.