Ionic push notificatoins


I’m about to implement push notification functionality in an ionic app. Currently I’m evaluating the alternatives on how to do this and I have a hard time finding the best solution. Should I use the ionic push service, or Parse or perhaps another solution?

The use case is that we will generate messages server side depending on different events. The message is specific to a user (which has to log in to the app in order to get access). When the user navigates to his/hers inbox in the app, all messages are shown there. When the message is generated a push notification should be sent to the user that a new message has been received (togehter with a short summary if the message) and if the user pushes the notification he/she should be redirected to the inbox in the app.

The app is deployed on both IOS and Android devices and I cannot assume that a device will always be used by only one user.

EDIT: Forgot to add that the notification also should be able to be recieved even if the app is running in the background,

This is what I used for the same case:

Hi and thanks for your reply.

Perhaps a stupid question, but how does the app know which push service to listen on? In the api docs for phonegap-plugin-push I cannot find any parameter for specifying the notification provider. Does, for instance forward the notifications to APNS or GCM?

@niklas_ngenic Pusher services has nothing to do with CGM or APNS it’s more an API to manage your events like used for:

  • Multiplayer gaming.
  • Badge notification.
  • etc …

Regarding to the plugin cordova-push-plugin, this is what you need, I provided some instructions about how to setup with Android GCM here: Ionic is not defined when using ionic-push

Hope it helps!

@Devniz But can I recieve notifications messages even if the app is running in the background?

Yes you can do that with cordova-push-plugin.

@Devniz, Sorry But I still don’t understand where to define which push service to use with the phonegap-plugin-push. For instance, I have been looking into services. If I would like to use the plugin against Parse, I need to tell the plugin somewhere which service to register to?

Please read the documentation of cordova-push-plugin, you need to fetch your registerId and configure GCM in your Google developer console, witch will serve your pushing system. As I’ve said I also provided instructions about how to use push notification.

I have good experiences with Ionic Push, worked great for me after some initial hurdles.

The issues I had were related to the Ionic Web Client app interfering with Firebase and some issues with the GCM setup, but I was able to work around/fix these.

For the rest, Ionic Push worked great for me, it was fast and reliable, it was easy to set up and get working, I didn’t feel the need to look at 3rd party/other solutions.

With pusher, I can’t find where you would push to a specific device. It seems like pusher is more for channel notifications, rather than per-user notifications. Is that right?

@leob Hi, I want to implement simple push notification service in my application from scratch level. What I have to do? Please give me any link that shows the steps needed for developing a push notifiction based ionic application?

Thanks in advance.

@alsrk666 I can share some code from an app that I developed, the problem however is that it’s based on Ionic Push ( Alpha, so it stopped working already, I need to upgrade it to Beta, when I’ve done that I can share the code with you (via Github) …

By the way, one problem I solved specifically was to get Ionic Push working alongside Firebase in one and the same app … because that was really a problem, when you implemented Ionic Push in the “standard” way then Firebase did not work anymore.

@leob Thank you so much. And now I’m trying to build an app to test the push notifications in application by following this url Can I continue with my process ? or else any suggestions to implement push services?

Thank you.

You can follow that guide, unless you use Firebase. My approach fixed a problem with the combination of Firebase and push.

(in fact it was the “Ionic Client Library” that was messing up something with Firebase, so what I did was find a way to implement Push without using the Client Library, which turned out to be quite easy)

Hi, i also want to implement push notification functionality in an ionic app which is deployed on 3 platforms IOS, Android and Windows Phone. My question is, if i use 1) and 2) is this going to work for windows phone or not?