Ionic Push: Retrieving push notifications using API call


#1

Hi all,

I am new to ionic 2 and I am learning it. I am creating an app using this great technology and so far, I am able to send push notices from my account in https://apps.ionic.io/. The notices are also received correctly in devices. Right now I am creating a component to display all the push notices using push API call. For that I have written an API call using PHP and it works also fine except that it retrieves all push notices even those were deleted from https://apps.ionic.io/. Can anyone please advise how to view only those push notices which have not been deleted?

The api call I make is https://api.ionic.io/push/notifications using PHP curl.

Thanks in advance.


#2

Documentation for this endpoint lives here:
https://docs.ionic.io/api/endpoints/push.html#get-notifications


#3

Hi Sujan. Thanks for the reply. I am using that documentation to code my script. I able to use /push/notifications (which I have already mentioned in my question as https://api.ionic.io/push/notifications) to retrieve push notifications. My question was how to get only the notifications which have not been deleted yet. The API call for /push/notifications shows several messages with message body as “Hello World!” while these messages are test messages which I have deleted several days back. I want to filter those old deleted message. Please check this API call demo page I created - http://sv360.catholicschoolcanchipur.org/api.php/getallalerts/. You will see several old messages with message body as “Hello World!”

Thanks


#4

If the docs don’t mention a way to filter these, then there probably is none. Maybe you could try to filter these from the number of successful recipients or something that is returned?