richsage / RMSPushNotificationsBundle

NOT MAINTAINED! ⛔️ Push notifications/messages for mobile devices. Supports iOS, Android (C2DM, GCM), Blackberry and Windows Mobile (toast only). A Symfony2 bundle.
MIT License
321 stars 152 forks source link

Connect once to APNS and send all pushmessages over that connection #14

Closed mac-cain13 closed 11 years ago

mac-cain13 commented 12 years ago

This fixes issue #13.

mac-cain13 commented 12 years ago

Please wait a moment before merging this commit into master, after sending a corrupt pushmessage to the server all other messages will not arrive. I have to solve this before any of these changes will be of any use.

Sorry for not detecting this before submitting the pull request!

richsage commented 12 years ago

Awesome - thanks for this! Speedy work :-) No problem, let me know when you're happy with it

mac-cain13 commented 12 years ago

I fixed the biggest problems. Your messages will be resend if we detect that they didn't get through, this makes this pull request good enough for me to be useful and a win. There are some feature/edge cases that aren't supported yet:

Are there issues that you feel we should solve before we can merge this into the master?

gonzaloserrano commented 11 years ago

is there any play to merge this soon? :-)

richsage commented 11 years ago

Yes - sorry, had a busy couple of weeks. I will try and review & merge this week :-)

richsage commented 11 years ago

OK - this all looks good to me - thanks for your work on it @mac-cain13! I'll merge now. Re. the points you mentioned above, they all sound like good improvements. Particularly the new timestamp - it would be good at some point in the future to be able to specify the expiry time on a per-message notification if required, but that can come later :-)

Thanks again!

christian-kolb commented 11 years ago

Could you please provide a example how to send multiple messages at once?

mac-cain13 commented 11 years ago

Hi @christian-kolb,

This PR makes the library send all messages over the same connection. So you don't send multiple messages at once, but one by one and the library will make sure the same connection to Apple is used all the time.

Note that I've now switched to my own library Notificato, because I kept getting strange errors when sending somewhat higher volumes of messages. It's quite nasty to get it right since PHP isn't handling the connection to Apple to well in the case of disconnects/errors.

So you could also check out Notificato and the [Notificato Symfony bundle]. This will also give you the option of sending multiple messages at once.