iOS Question Clear push notification once sent

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

Just wondering if there is a way to clear the push notification once it has been sent ?

As an example, I send the push notification to 2 phones. If UserA opens the app I want the notification to clear from UserB phone.

I noticed the Gmail app does this. I get a push notification when a new email comes through and if I read the email from my desktop, the push notification disappears from my iPhone.

Just trying to do the same thing with my app.

Any ideas on how to do this ?
 

aaronk

Well-Known Member
Licensed User
Longtime User
Try to remove the title, body and sound.
Nothing happened on my phone once it was sent.

I sent a FCM with title, body and sound, and then sent another (to the same topic) but left the topic, body and sound fields blank but it didn't remove the notification.
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
I see what I was doing wrong.

I was sending the original notification with the body, title and sound.
I then sent the empty title, body and badge set to 0
By doing the above nothing happened.

I had to include the badge number in the original push notification, so when I send the second push notification with the empty title, body & badge set to 0, it cleared.
 
Upvote 0
Top