Ionic Push Notification Problems


#1

I am working with Ionic Notifications right now. I have gotten them to work for the test application but I have a few questions.

  1. How do I make the notifications only show up when the user is not in the app?

  2. How do I make the notifications appear when after a certain event? For example they are working right now but only when I send a notification from Ionic’s services website. I want it to show a notification whenever a user gets messaged.

Thank you for your help,

Darrell


#2

There is an API you can call at https://docs.ionic.io/api/endpoints/push.html Creating push notifications is here: https://docs.ionic.io/api/endpoints/push.html#post-notifications


#3

Do you have an example of how to use the api in the code? I can’t figure out how to implement it in the code. For example, how do you add the notifications? Do you put the same variables in the code inside of the API?


#4

#5

This is an API. You call it sending an HTTP request to it. To debug, usually you use something like Postman or another HTTP Client to construct a simple request to the API and fire it off. Then you implement it in some backend language like PHP, Python or similar on the backend into your backend application.