Namespace: Notification

WonderPushSDK. Notification

Methods

getSubscriptionState() → {WonderPushSDK.SubscriptionState}

Get the current subscription state.

Returns:
Type
WonderPushSDK.SubscriptionState

requestPopupToFinalizeRegistration(defaultUrl) → {Promise}

Do not call manually. This function is called when we need to open directly a webpage served by HTTPS and having the manifest and WonderPushSDK in order to finalize the push registration. It is only needed for pages that do not satisfy these 3 criteria already.

To bypass popup blockers, the page should only been opened as a direct result of a user click, that's why we need to show some message, inviting the user to click on a button.

This function displays such a modal message, and points a proper page (given as argument to this function). Feel free to override it as desired. You can even intercept the call to override the URL parameter. Just don't forget to return either the original return value, or equivalently, a Promise that resolved once the push registration is available and that rejects on failure.

Parameters:
Name Type Description
defaultUrl string

A URL to a proper page to load. You can use any other page that is: served using HTTPS, has a manifest, and loads the WonderPush SDK.

Returns:
Type
Promise