It's a callback function that takes a boolean value of the check result as a parameter.
API response
Value
Type
The result of checking Web Push support
boolean
Example of use
personaclick("subscription", "web_push_supported", function(supported) {
if (supported) {
// if Web Push is supported
} else {
// if Web Push isn't supported
}
});
Checking a user's subscription status
Method Objective
The method checks if the user has permitted to show Web Push notifications.
It's a callback function that takes a boolean value of the check result as a parameter.
API response
Value
Type
The result of the permission check
boolean
Example of use
personaclick("subscription", "web_push_subscribed", function(subscibed) {
if (subscibed) {
// if the user has permitted Web Push notifications
} else {
// if the user hasn't yet permitted Web Push notifications or has rejected the request
}
});
Subscribing a user
Method Objective
The method allows subscribing the user to Web Push notifications using only the system permissions window in the browser.
We recommend using the Programmatic Pop-Ups tool for more flexibility in configuring the user's subscription to Web Push notifications.
It's a callback function that takes a boolean value of the user's subscription result.
API response
Value
Type
The result of subscription
boolean
Example of use
personaclick("subscription", "web_push_subscribe", function(subscibed) {
if (subscibed) {
// if the user has subscribed to Web Push notifications
} else {
// if the user rejects the Web Push notification subscription
}
});