Android Question Firebase messaging to open the app

Mark Ryan Penafiel

Member
Licensed User
Longtime User
I am trying firebase messaging and its working. i am trying to open the app everytime it received a message but its not working. is this possible?

tried some sleep codes and if statement to test but its not working.

Thanks in advance

[CODE lang="b4x" title="fm_MessageArrived"]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)
StartActivity(Main)

Sleep(1000)

Log(IsPaused(Main))

If IsPaused(Main) Then
StartActivity(Main)
Else

End If
'
End Sub[/CODE]
 
Back
Top