title: How can I find out why Safari Push notifications don't send
body: <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>