I am working on a php website + iphone application and API for iphone application, has a messaging system for students and doctors, when any one sends message(from website or iphone) the other user should get push notification on his iphone. For example if student adds a new question for teacher, a push notification on teachers iphone/ipad will be send to teacher andwhen teacher reply to student's answer, student will get a push notification. Since there is no restriction on number of teachers and student registering to website. So my question is how to send push messages to registered users iphone, I want to send push message as soon as some one reply or add question. Please provide me php code for sending multiple push messages. I am saving device token for each user while registration.
When teacher reply to question I am sending mail to student, I want to send a push notification too to student and vice versa so please specify code able to manage error conditions.
Please suggest any tutorial for sending push notifications on iOS.
Simple way to do it without use any file. You can call it multiple times with different tokeid.
This is a pretty good tutorial on all that. Helped me setup my server and demo app http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
You should better use APNS library for PHP. You can find it here. Look through samples that developers provide.
I also had problems with certificates. My actions were:
ApnsPHP/Abstract.php
make some changes to
_connect()
method, paste this linesinstead of original listed there
now you can use *.pem certificates without need of entrust_root_certification_authority.
This worked fine for me.
This is the way I have done it finally