Permission and Subscription methods + Misc fixes & Improvements
New methods
getPermissionSubscriptionState
- Returns an object with permission and subscription instances with:
subscription.userId
,subscription.pushToken
,subscription.useSubscriptionSettings
,permission.hasPrompted
,permission.status
addPermissionObserver
onPermissionChanged
will fire when user changes iOS notification settings.- Includes Accepting, Declining, Prompting, and toggling iOS notifications in Settings after going back to the app.
addSubscriptionObserver
onSubscriptionChanged
will fire when notification subscription properties change.- Includes
userId
,pushToken
,userSubscriptionSettings
, andsubscribed
promptForPushNotificationWithUserResponse:
method. Use instead ofregisterForPushNotifications
. This new method accepts a callback that will fire when the prompt is answered.- Added
inFocusDisplayType
property. Use instead ofkOSSettingsKeyInFocusDisplayOption
. This new property can be set at anytime in your app.
Documentation:
See the OneSignal SDK API documentation for full details on the new methods listed above.
Improvements
- Can now set
app_id
as part of the payload topostNotification
to send to another app. - Fixed extra network calls in some edge cases.