Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.safari.pushNotification.requestPermission always returns "denied"

EDIT: I found the solution for implementing Safari Push Notifications and blogged about the process at: http://samuli.hakoniemi.net/how-to-implement-safari-push-notifications-on-your-website/

... When clicking "subscribe", it should enable push notifications for Safari 7.x on OSX 10.9.x.

Push notifications works on http://www.macrumors.com/ where they've implemented it. However, on my own test website, I always get "denied" as permission result without Safari even prompting it at all.

So: I don't get any prompt for allowing permission for push notifications, just a callback with permissionData.denied.

I found this question from SO with similar problem: Safari push notifications return denied without asking

But unfortunately it didn't offer me any advice.

like image 302
Samuli Hakoniemi Avatar asked Nov 12 '22 17:11

Samuli Hakoniemi


1 Answers

When asking for permission, the browser contacts the endpoint that downloads the pushpackage of your site. The endpoint be restFUL and must run over "https". A self-signed SSL certificate does not work. Also, the push package must be valid for the user to be prompted. My advice is to get the logging endpoint working correctly so that you can at least know what is going on and where it's failing.

like image 170
Nick Avatar answered Nov 15 '22 02:11

Nick