2

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)

Marco Castelluccio
  • 10,152
  • 2
  • 33
  • 48
Ananth
  • 205
  • 3
  • 13
  • Try using a service like Pushpad: it has a PHP library and given the cert it generates the APNS package for you – collimarco Aug 29 '16 at 08:34
  • Thanks for reply @collimarco ... Actually I am trying it my self... I am getting token.. but notification is not coming to safari... Its something related to the certificates.. Or I don't know whats happening. – Ananth Aug 29 '16 at 12:37

1 Answers1

1

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":[""]
        }
 }
joe
  • 2,468
  • 2
  • 12
  • 19
Ananth
  • 205
  • 3
  • 13