Blog Stats
  • Posts - 197
  • Articles - 0
  • Comments - 36
  • Trackbacks - 0

 

Safari Push Notifications - Working

So its taken me some time, but I finally have managed to enable Safari push notifications on my Bin Collections website. 

Take a look at http://binaryrefinery.com/bincollections

So now if you are a Mac user, using Safari and happen to live in the South Cambridgeshire area I can send you a notification when and which bin to put out.

I implemented the backend in ASP.NET using a handler to receive the messages that Apple pushes out as users sign up or remove themselves from the service.

Gotcha’s along the way.    Apple uses a restful API,  so you must get your handler to listen for all the relevant HTTP Verbs,  GET,POST,DELETE.

Once I got this cracked and assembled a push package things started to work!

 

Another thing to watch out for,  Apple changed the intermediate developer certs.   Make sure you have the latest set on your development machine before you start.  I didn’t, and my keys all didn’t get signed correctly.   Please look at - 

https://developer.apple.com/support/certificates/expiration/

 

 

If you have an error, and Apple sends you a log to your Web-service complaining about a push package.   I’ve found the only way to get things working again is to disable and enable push notification support for your website in Safari for the offending Mac that you tried to push the message too.

As well as sending weekly reminders,  I also send via push if you change any of your alert settings

NewImage

I implemented much of the backend using a database of which certificates and keys to use,  this should make it much easier to use Safari push for other projects and challenges.   This database also logs to a table any logging or errors that Apple reports back.

 

If your thinking about trying this yourself (I’m of course happy to assist).  Please read and re-read the Apple guides.     They do have everything there you should need.   I also have found apple Developer support first rate in guiding me through which now appears like stupid errors. 

https://developer.apple.com/notifications/safari-push-notifications/


Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

 

 

Copyright © Richard Jones