I am using the following code.
try {
const registration = await navigator.serviceWorker.ready;
const subscription = await registration.pushManager.getSubscription();
await subscription.unsubscribe();
} catch(error) {
throw error;
}
Even After this code executes successfully, When I refresh the page and log Notification.permission
, it's still granted. But It should be default
. Am I missing something ?
If user grants the permission for the first time, and then unsubscribes, Notification.permission
never changes ?