Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I find out why Safari Push notifications don't send
    primarykey
    data
    text
    <p>I'm trying to implement the new <a href="https://developer.apple.com/notifications/safari-push-notifications/" rel="nofollow">Safari Push notification service</a> for a website. I've been using a <a href="https://github.com/connorlacombe/Safari-Push-Notifications/" rel="nofollow">demo template on github</a> as a starting point.</p> <p>What's working: Safari correctly prompts to enable notifications from the host site The push service correctly logs the device id to mysql, and removes it as needed. So arguably the trickiest part is all ok. I've checked that the <a href="https://kandutech.net" rel="nofollow">demo test site</a> is working for me perfectly.</p> <p>I've modified the demo code to push data to all devices, rather than by id. Again this seems to be ok. Triggering a push notification however is not working.</p> <p>I've verified that the server is able to talk to the APNS server with <code>openssl s_client -connect gateway.push.apple.com:2195 -CAfile apns-cert.pem</code> where apns-cert.pem is converted from my p12 file from Apple.</p> <p>No errors are returned by <code>stream_socket_client</code> and I've dumped the output of the json data sent, and it looks ok:</p> <p><code>"{"aps":{"alert":{"title":"Test notification","body":"This is a test push notification","action":"View"},"url-args":[""]}}"</code></p> <p><strong>Bonus question</strong> Do I need to send the push notification from the same server that creates the push package, or can I send it from anywhere as long as I have the certificate and the device ID?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload