1
votes

How feasible it is to send the message from same server [ ex: php/apache ] to Google Cloud messaging [ GCM] and Apple Push Notification [ APN ? ]

I have the code in php which sends the message to GCM, and i would like to get messages for iOS App too. What i felt is to send the message again from php code to APN?

Kindly suggest.

3

3 Answers

1
votes

Everything is feasible. It all depends on the amount of work you are willing to put into it. You may look into the APIs of some 3rd parties (like UrbanAirship or Parse.com) that support push notifications to multiple platforms, to see how their APIs support these multiple platforms.

You should realize that APNS and GCM use different protocols (APNS has its own binary format over TCP, while GCM supports HTTP and XMPP), have different device identifiers (device tokens vs. registration IDs), have different payload parameters and payload max length, etc...

Due to those differences, at least in the end points, it wouldn't be the same server code that sends notifications to both APNS and GCM.

You can still have a lot of common code that is platform independent, such as the code that composes the notification to be sent, but the sending itself would be different for each platform.

1
votes

Now with GCM (Google Cloud Messaging) latest version announced at Google I/O 15, it supports iOS platform. So you can use same codebase at backend to target both Android and iOS devices.

Anyhow you have to link GCM with APNS to push messages when iOS app is not active.

0
votes

Golgi is an API that could potentially handle your APN and GCM push notifications.

Golgi is a communication API and service that can send both APN and GCM to your app on your behalf. Golgi uses push notifications to alert apps that there is data to receive either from a server or another app instance. Your app would then connect to collect the data.

Golgi keeps track of users and what device they are using (iOS or Android) and uses the relevant push notification system.