1

I have a task to implement push server for mobile application that support as many platforms as possible. I need suggestions for what would be the best way to go.

After some research I found that GCM supports native iOS devices and Android of course. So in a perfect scenario I would also like to support iOS/Android devices on cordova(hybrid apps). Can GCM be used to support all these platforms and if not, what would be other ways to solve this problem?

This is one of my first more serious programming tasks so any help will be appreciated.

I am interested if GCM support iOS on cordova and is it better to use GCM or code something from scratch for different platforms?

Bojan Trajkovski
  • 1,056
  • 1
  • 15
  • 31

2 Answers2

1

Yes you can use GCM for both IOS and Android. Here are some useful links to start.

Cloud Messaging

Google Cloud Messaging for iOS

Cloud Messaging for Android

Also see existing SO PhoneGap Build Push Notification

Cheers !

Community
  • 1
  • 1
Sachin Thapa
  • 3,559
  • 4
  • 24
  • 42
  • I know that it supports those platforms, what im not sure about is iOS on cordova and would u suggest using gcm for this or creating something from scratch. – Bojan Trajkovski Jul 07 '15 at 17:41
  • If you are doing hybrid development IOS on cordova is no problem but would recommend using apns for IOS and GCM for android. – Sachin Thapa Jul 07 '15 at 18:03
0

I've finished this project and after some research this are my conclusion

GCM for iOS

  • have lot of limitations(no alert in message)
  • uses APNS as a wrapper
  • still no plugins in cordova

So for now my suggestion is APNS for iOS and GCM for Android.

Bojan Trajkovski
  • 1,056
  • 1
  • 15
  • 31
  • What do you mean by "no alert in message"? – evanescent Sep 30 '15 at 01:25
  • I mean in [GCM reference for iOS](https://developers.google.com/cloud-messaging/http-server-ref) there is no `alert` field. This field is used in iOS to show notifications on iOS devices. This field is of course available in APNS. – Bojan Trajkovski Sep 30 '15 at 10:24
  • That's not true. It's supported as `body` parameter in GCM. The GCM message would be something like `{ 'to': $to, 'priority': 'high', 'notification': { 'body': 'Hello World' }, }` This would translate to `aps: { alert: { 'body': 'Hello World' }}` for APNS. – evanescent Oct 01 '15 at 00:26