Thursday, March 28, 2013

PHP : Apple Push Notification (APN)

Hope you have read my previous post for Rails 3 : APN on Rails in which I tried apn_on_rails gem for sending notification to apple devices. I have also added the link for ManiacDev.Com in which you will get the steps for certification creation which are the most important steps for notifications.

Now for sending notification in PHP there is a great example available at : Apple Push Notification Services Tutorial: Part 1/2. You can download the example file at from given link in the post.

This is a PHP sample code. Just change the deviceToken, passphrase and message variables. Make changes as per your requirement. But again I faced some certification errors which were : ssl_connect returned=1 errno=0 state=sslv3 read finished a sslv3 alert certificate unknown and Neither PUB key nor PRIV key:: nested asn1 error. Nothing else got the wrong certificate generated. Just get the required certificate and you are good to go.
I really loved it.

No comments:

Post a Comment