Check if users have enabled browser push notifications via Snapshots
On modern browsers, you can check how many of your users have enabled your browser push notifications. You can do something similar for checking location permissions if your app depends on it (not compatible with all browsers).
The Snapshot below adds whether the user has enabled push notifications or not as a Heap user property by triggering Heap’s client-side [heap.addUserProperties()](https://developers.heap.io/reference#adduserproperties)
API.
navigator.permissions.query({
name: 'notifications'
}).then(function(result) {
heap.addUserProperties({
"Notifications Permission": result.state
});
})
Updated over 1 year ago