PushNotification guide for android


#1

Hi,
I am using cordova and ionic to deploy the apps on android and iOS. I need an end to end guide on how to use PushPlugin in the ionic app to make it work for android.

I have already followed Phonegap guides to PushPlugin, but it doesn’t work as expected. I also followed this blog:
http://intown.biz/2014/04/11/android-notifications/

but it only returns OK as a message in the successhandler callback. I am not able to get the registered Id in onNotificationGCM callback(it doesnt fire).

Any pointers on this would be greatly appreciated.
Thanks


#2

I use Urban Airship for handling PushNotifications for iOS and Android with my phonegap application(s).
They provide a custom plugin for this and it’s working like a charm.
Integration is much easier this way


#3

There are Azure Mobile Services, too.


#4

We’re hoping to get services set up soon that can integrate push notifications with ionic that are more geared to work with angular. For now, Urban Airship is pretty good. I’ve used Pushwoosh myself, fairly straight forward and they provide a WYSIWYG interface for handling notifications.


#5

Thank you guys for quick responses. I opted to go for Pushwoosh and it works pretty good when I push notifications manually via their web console. Can somebody please share some ideas about how to integrate Pushwoosh with server ? This could be a stupid question, but I am a rookie to push notifications :smile:


#6

Well the point of these services, regardless of which on, is that you don’t have to manage the server, they do. A big reason why I opted for a service over setting up my own server is

  1. Too much for me to do ( sole person on the project)
  2. I’m not a server guy, servers scare me lol

These serves handle the deployment and server side of things, you just manage the front end.


#7

Well I’m right on your back in case of servers @mhartington :smile: And thanks for the info, greatly appreciated.


#8

I use the Aerogear Unified Push Server and their cordova push plugin. I host the push server on OpenShift. There is a cartridge for Aerogear and MySQL. Another huge bonus, its all free. It took about 15 minutes to have it up and running.


#9

I’ll take a look. I’m oriented to use Azure mobile services.


#10

Aerogear’s Push Plugin is a steaming turd.

If you’re interested in using any other plugin requiring:

  • com.google.android.gms
  • com.android.support

then expect the joys of failed builds from Aerogear specifically demanding builds and library versions that conflict with anything built correctly. Throughout their plugin, they’ve explicitly defined minSdkVersions (yes plural), which force the requirement of adding " – --minSdkVersion=15" flags on every command. ie:

cordova compile android – --minSdkVersion=16
cordova build android – --minSdkVersion=16
cordova run android – --minSdkVersion=16
cordova emulate android – --minSdkVersion=16

Even this does not fix the issue. It leads on to “UNEXPECTED TOP-LEVEL EXCEPTION” errors from using an outdated way to declare dependencies such as android-support or play-services-gcm.

Do yourself a favour and consider any other option.