Android Question Clear push notification when pressed

Almog

Active Member
Licensed User
Hello,

Recently, I've added FirebaseNotifications to my app
I noticed that noticed when the user click the (push) notification, the app opens, but the notification still exists, and it is needed to swipe it in order to remove it.

Does anybody know how to make the push notification disappear when the user clicks it (and then the app will open)?

Thanks in advance
 
Add:
Code: Copy
Notification.AutoCancel = True
I now tried it, but when 'publishing' the notification, it didn't appear at all...
Code: Copy
Sub fm_MessageArrived (Message As RemoteMessage)
    Log("Message arrived")
    Log($"Message data: ${Message.GetData}"$)
    Dim n As Notification
    n.Initialize
    n.Icon = "icon"
    n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
    n.AutoCancel = True
    n.Notify(1)
End Sub
Do you know please what the problem is?
 
Upvote 0
Do you know please what the problem is?
that you are not reading any documentation.

SetInfo should be the last command before notifiy
 
Upvote 0
Back
Top