Android Question firebase notification question

zak

Member
Licensed User
Longtime User
Hello. I followed the various posts in the forum on how to setup firebase push notification and was able to send a push notification from my server to my samsung note4 via its token. However the second notification I send will delete the previous notification and take its place.. is there a way to show all the notifications on the phone on top of each other so I wont miss any?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the code that creates the local notification:
B4X:
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) '<-----------------------------
   Log(Message.SentTime)
End Sub
You need to use a different id for each message if you want to show all of them.
 
  • Like
Reactions: zak
Upvote 0
Top