How can i do a push notification service with a webservice on Ionic?

Ok, i need some help…
I’m finishing an app but i need some kind of service who looks in my backend and when my JSON changes (this JSON contain some valors who changes if the user get notifications) send to that user a pushmessage to the terminal even the app is off. Something like an ajax call every ‘x’ seconds but doing it in mobile.

I’ve past a few days searching but i’m completly lost and i need some kind of tutorial, example or something.

I’ve searched in the forum but i doesn’t find anything.

Thanks anyway

You need a service/script/thing in your backend that runs via a cronjob and checks for changes in the JSON. If there are any, it uses the API of your push notification provider (there are many, googling will give you some) to send a push to the relevant user. On the app side you have implemented push and can handle it whatever way you like.

1 Like

whats a cronjob? What push notification service do you recommend me?

A thing that gets executed regularly. Use Google for more info.

The one that fits best for your needs. Firebase or Onesignal are popular choices.

And in wich part of the code is activated that firebase? In the server or in the mobile client? Sigh

As I wrote, in the backend.
The mobile app is just a dumb client.

Anyone can show me an easy example of firebase implamentation on ionic?

In backend and in Ionic.

Thanks

Maybe with this plugin i can achieve that?

Not necessary. As I wrote, you only have to implement push notifications with your chosen provider in your Ionic app. All the rest is done in the backend server application that talks to your push provider’s API to trigger the sending of the notification.

Ok thanks for all of the tips… Maybe i can use this tuto or you would recommend me another?