Reputation: 152
I am developing a webpage where the next page depends upon whether the user allowed push notification.
When the user clicks on to allow, it should go to one page and if the user clicks on Not allow then on another.
Upvotes: 0
Views: 783
Reputation: 1016
You can add a callback function to the notification request as follows:
Notification.requestPermission().then(callback);
The callback function gets a result
parameter, the value of the result determines if the notifications were allowed, denied or dismissed.
Upvotes: 3