DestroShark
Member
Hello
Faced such a problem that by sending a message to a specific topic from one device, the message is displayed in any topics(which both devices are subscribed). The problem is in the function fm_MessageArrived I call the method in the function to display messages, how can I display them in only one topic? I would be very grateful if anyone can help me.
Best regards
Faced such a problem that by sending a message to a specific topic from one device, the message is displayed in any topics(which both devices are subscribed). The problem is in the function fm_MessageArrived I call the method in the function to display messages, how can I display them in only one topic? I would be very grateful if anyone can help me.
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim n As Notification
n.Initialize
n.Icon = "icon"
Dim strArray() As String =Regex.Split(";",Message.GetData.Get("title"))
n.SetInfo(strArray(0), Message.GetData.Get("body"), ChatMainMenu)
If chatex.myMail = strArray(1) Then 'strArray(1) - contains mail
CallSub3(chatex,"myMessageArrivedOnChat",strArray(1),Message.GetData.Get("body"))
Else if chatex.myMail <> strArray(1)Then 'strArray(1) - contains mail
n.Notify(1)
CallSub3(chatex,"AnotherMessageArrivedOnChat",strArray(1),Message.GetData.Get("body"))
End If
End Sub
Best regards
Last edited: