Hi all,
It`s a very strange problem and I don't know if I can describe it well,
I am using firebase messaging according to this instructions and it is not useful to upload my code because it`s just the same,
The problem is that I want to custom the notification (for example if a body = "new_call" notify "test")
So there are two situations:
1. Release mode, the app in foreground => the code works fine
2. Release mode, the app in background => the notification shows the message body received even it was "new_call" !
I'm on my way to having a heart attack
Update: I cancelled the if condition like this :
so the result is more confusing now :
1. Release mode, the app in foreground => the notification always "test"
2. Release mode, the app in background => the notification shows the message body received !!!!!!
It`s a very strange problem and I don't know if I can describe it well,
I am using firebase messaging according to this instructions and it is not useful to upload my code because it`s just the same,
The problem is that I want to custom the notification (for example if a body = "new_call" notify "test")
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim n2 As Notification
n2.Initialize2(n2.IMPORTANCE_HIGH)
n2.Icon = "icon"
if Message.GetData.Get("body") = "new_call" then
n2.SetInfo(Message.GetData.Get("title"), "test", Main)
Else
n2.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
End If
n2.Notify(1)
End Sub
1. Release mode, the app in foreground => the code works fine
2. Release mode, the app in background => the notification shows the message body received even it was "new_call" !
I'm on my way to having a heart attack
Update: I cancelled the if condition like this :
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim n2 As Notification
n2.Initialize2(n2.IMPORTANCE_HIGH)
n2.Icon = "icon"
n2.SetInfo(Message.GetData.Get("title"), "test", Main)
n2.Notify(1)
End Sub
1. Release mode, the app in foreground => the notification always "test"
2. Release mode, the app in background => the notification shows the message body received !!!!!!
Last edited: