Safari Push notification is not working

1.6k views Asked by At

I have been trying Safari push notification. I followed the Apple doc.

Downloaded Apple intermediate Certificate AppleWWDRCA.cer. Exported my website provisioning profile as p12. To create the push Package used ruby package push_package

It created a package zip and it contains all the details that we needed - icon.iconset, manifest.json, signature and website.json.

When I request permission it successfully retrieves all data and gives me token.

But the real problem is when I try to send notification from a PHP script or APN tester its not receiving in the safari. The v1/logs getting called instead with some circular Json object.

Have no idea what to do next. can anyone please help ??

And one more thing I found is, in the logs SafariNotificationAgent (unknown version)

1

There are 1 answers

0
Ananth On

The error was in payload that I used.

It should be like:

 {
    "aps":{
          "alert":{
                   "title":"Hi there",
                    "body":"How are you",
                    "action":"viewed"
                  },
         "url-args":[""]
        }
 }