Recommended Push Notification Implementation Method

I am creating an application for Android and iPhone. This application should receive notifications of new messages in the user's mailboxes. Being a complete noob in a dev application, I was wondering if any of you can suggest a better way to implement what I need here.

I read more on Android than iPhone, so my understanding of the latter may be desirable. Based on what I read and understood, I believe that I will need to start the service when my application starts for the first time (or instruct the device to start the service every time the device starts or something else). This service will then interact with the server to receive notifications and display them. By clicking on the notification, you will launch the application.

My parameters

  • C2DM or APNS

  • City airship

  • My own server, which mainly uses idle TCP connections to the client.

Depending on the option that I choose, it changes the implementation on the client side, as well as the changes on the server side.

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

Any help is greatly appreciated.

Update:

Build jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my notification application means that APNS must be used. Thus, option 3 is completely absent. This means that we remain either with Urban Airship, or are directly connected to APNS and C2DM. Based on my research, the efforts associated with both cases are comparable, so it makes no sense to post an additional 4-5K / mo to support notification. Therefore, I plan to implement option 1. If any of you think differently, leave comments below.

Thanks.

+6
source share
6 answers

They will have to be processed separately. In the case of iOS push notifications, you will have to go through the Apple Push notification service (the programming guide is here ), they have a very specific protocol, your server will need to correspond to that described in the Provider’s Communication with Apple Push Notification Service . I don’t know about Android, it will probably be completely different, less centralized.

+2
source

Build jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my notification application means that APNS must be used. Thus, option 3 is completely absent. This means that we remain either with Urban Airship, or are directly connected to APNS and C2DM. Based on my research, the efforts associated with both cases are comparable, so it makes no sense to post an additional 4-5K / mo to support notification. Therefore, I plan to implement option 1. If any of you think differently, leave comments below.

+1
source

C2DM would be the lightest possible. But, I think you can also try Urban Ship. Implementing your own server is a pain.

0
source

My situation is very similar, and I first released an Android app, and now I'm working on an iOS app. For Android, I implemented push notifications using C2DM, and I send notifications from my Google App Engine (GAE) application. C2DM basically requires sending HTTP messages to a Google server. So you send the HTTP POST to the URL https://android.apis.google.com/c2dm/send .

iOS, however, requires a dedicated TCP connection on the proprietary port, and the GAE environment does not allow the use of an external protocol other than HTTP through port 80. So I did a lot of research, and this seems to be the answer to the Urban Airship question. They provide an HTTP interface that I can access from my GAE environment, and they translate this into a protocol that Apple's servers understand. Their price seems confusing, although - 1 million free notifications per month and a tenth of the percentage for notification after that. Is it beatza because they give $ 1,000 a month for free? Very economical weird. I am thinking about trying them out, but I think the best alternative with large volumes is to simply use your own implementation and deploy it on Amazon AWS or buy another cheap third-party hosting.

0
source

Important: C2DM is officially deprecated as of June 26, 2012. This means that C2DM stops accepting new users and quota requests. No new features will be added to C2DM. However, applications using C2DM will continue to work. Existing C2DM developers are encouraged to upgrade to a new version of C2DM called Google Cloud Messaging for Android (GCM). See the migration document C2DM-GCM for more information. Developers should use GCM for new development.

0
source

I cannot shed light on the Android side, but I can say that I recently installed an incredibly simple Rails application on Heroku, which sends push notifications to my iOS application via APNS. I used the houston gem and received push notifications in my iOS application in less than 20 minutes after I got started.

0
source

Source: https://habr.com/ru/post/901495/


All Articles