Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended way to implement Push Notifications

I am building an App for Android and iPhone. This app needs to receive notification for new messages in user's inbox. Being a total noob in app dev, I was wondering if any of you guys could suggest the best way to implement what I need here.

I have read up more on Android than iPhone so my understanding of latter may be wanting. Based on what I have read and understood, I believe that I will need to start a service when my app launches for the first time (or instruct the device to start the service every time the device starts or something). This service will then interface with a server to receive notifications and display them. Clicking on the notification will launch the app.

My options are

  1. C2DM or APNS

  2. Urban Airship

  3. My own server using mostly idle TCP connection with client.

Depending upon the option I choose, my client side implementation as well as server side implementation changes.

What will you guys recommend? Is there any other way to do what I need done?

Any help is greatly appreciated.

Update:

Building on jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my app for notifications means that APNS must be used. So option 3 is out altogether. This means we are left with either Urban Airship or interfacing directly with APNS and C2DM. Based on my research, the effort involved in both cases is comparable so it does not make sense to shell out 4-5K /mo extra just to support notification. So I plan to implement option 1. If any of you think otherwise, please leave comments below.

Thanks.

like image 368
spicavigo Avatar asked Nov 15 '11 09:11

spicavigo


2 Answers

They will have to be handled separately. In the case of iOS push notifications, you will have to go through the Apple Push Notification Service (Programming Guide here), they have a very specific protocol your server will have to conform to which is described in the Provider Communication with Apple Push Notification Service. Don't know about Android, it will probably be quite different, less centralized.

like image 119
jbat100 Avatar answered Sep 21 '22 22:09

jbat100


Building on jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my app for notifications means that APNS must be used. So option 3 is out altogether. This means we are left with either Urban Airship or interfacing directly with APNS and C2DM. Based on my research, the effort involved in both cases is comparable so it does not make sense to shell out 4-5K /mo extra just to support notification. So I plan to implement option 1. If any of you think otherwise, please leave comments below.

like image 44
spicavigo Avatar answered Sep 24 '22 22:09

spicavigo