Push Notification requestPermission() does not execute callback, hangs indefinitely

Originator:jason
Number:rdar://28741942 Date Originated:October 12, 2016
Status:Open Resolved:No
Product:Safari Product Version:10.0 (11602.1.50.0.10)
Classification:Serious Bug Reproducible:Sometimes
 
The Safari browser appears to be occasionally missing the callback to window.safari.pushNotification.requestPermission. We depend on this callback to know that the user either granted or denied permissions. If the user granted permissions, we depend on this callback to kickoff the registration flow.

This bug is most reproducible after first clearing all browsing data and permissions.

Steps to Reproduce (high chance of reproduction, not guaranteed):

1. Open Safari.
2. Visit Preferences -> Notifications, and Remove All notification permission entries. Make sure it's all empty!
3. Visit Preferences -> Privacy, and click Manage Website Data (Safari 10 only, then click Remove All), or Clear All Website Data... (Safari 9). Make sure it's all empty!
4. Restart Safari.
5. Visit https://onesignal.com/webpush. Do not click any buttons. Don't try to subscribe yet.
6. Open Safari's Developer Tools console.
7. Please run the code below:

window.safari.pushNotification.requestPermission(OneSignal._API_URL + 'safari', OneSignal.config.safari_web_id, {app_id: OneSignal.config.appId}, function(response) {
  console.warn('pushNotification.requestPermission Safari Registration Result:', response);
});

8. You should see the permission prompt appear, and clicking Allow should return a response. Sometimes a response is returned. Sometimes a response is not returned.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!