Reputation: 174
I'm testing safari 16+ versions' push api capabilities using a service worker. After i clicked allow on the push notification dialog, Notification.permission goes granted. Then for testing purposes i reset the notification permissions from settings->websites->notifications and remove the website i opted-in. Now this notifications list is empty but when i go to that site and check Notification.permission it still prompts "granted".
I was expecting to find a way to reset the permission state so that i can follow same steps from scratch. But i'm not able to make permission state to "default" once it is set. At first i was able to see the website in notifications list but after some time and couple of trials it shows nothing.
I tried to flush all the safari's cache, updating the version and restart the browser. But i couldn't find a way to reset this setting to be able to do tests from scratch. The list under settings->websites->notifications is still empty.
Tried safari Version 16.0 16.1 and 16.2 they all acted the same.
Upvotes: 1
Views: 1188
Reputation: 26
i've just found a workaround solution for this issue.
Your Notification Permissions are storing
~/Library/Safari/RemoteNotifications/Permissions.plist
file.
You can not change it on your terminal but you can follow this steps:
Permissions.plist
) on somewhere.<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
cd ~/Library/Safari
open .
RemoteNotifications
folder and open itPermissions.plist
file's name as old_Permissions.plist
(maybe you need it later)Permissions.plist
file hereUpvotes: 1