Android Question Pop-Up Message/Notification

interskala

Member
Licensed User
Hello, all,

The code below successfully sends a notification message from firebase cloud messaging. But it can't pop up like the whats app message.
Can someone suggest how to :
1. Bring up a pop up when the program reads incoming messages from firebase cloud messaging without having to lower the notification first.
2. When the notification is clicked, it immediately disappears from the notification list

Thank you for your help!


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.Notify(1)
End Sub
 

Attachments

  • test notif.jpeg
    test notif.jpeg
    33.1 KB · Views: 350

Erel

B4X founder
Staff member
Licensed User
Longtime User
Bring up a pop up when the program reads incoming messages from firebase cloud messaging without having to lower the notification first.
Initialize it with Initialize2 and set the importance level to HIGH.

When the notification is clicked, it immediately disappears from the notification list
Set AutoCancel to True.
 
Upvote 0
Top