Android Question is it possible to send Firebase notifications to a specific user?

omarruben

Active Member
Licensed User
Longtime User
is this solution ok?
send the notification text like this:

SERVER SENDS
title = "[45] Amouncement"
body ="Thank you for joining "

* where [45] is the user id

so on the App :

B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
    Dim user As String = Message.GetData.Get("title") '[45]Welcome
    Dim userid As String = user.SubString2(user.IndexOf("[")+1,user.IndexOf("]"))
    Dim cleantitle As String = user.SubString(user.IndexOf("]")+1)

   if (userid="45") then
    Dim n As Notification
    n.Initialize
    n.Icon = "icon"
    n.SetInfo(cleantitle, Message.GetData.Get("body"), Main)
    n.Notify(1)
  endif
 
Upvote 0
Top