'fm_MessageArrived
If Not(IsPaused(Main)) Then
Dim m1 As Map
m1.Initialize
m1.Put("param1", MData.Get("p1")) 'actual values are more meaningful; this is just to let you follow the flow
m1.Put("param2", MData.Get("p2"))
CallSubDelayed2(Main, "FCMOMessage", m1)
Else
'send simple notification
end if
'Main
Sub FCMOMessage(m As Map) 'message from service FirebaseMessaging
Log("**Main FCM OMessage**""")
Log(B4XPages.GetManager.GetTopPage.Id)
B4XPages.GetManager.RaiseEvent(B4XPages.GetManager.GetTopPage, "fcm_omessage", Array(m, 1))
End Sub
'Pages where showing a message is appropriate
Sub fcm_omessage(amap As Object, code As Int)
Dim mmap As Map = amap
Dim msg As String = $"BlahBlah${CRLF}Param1: ${mmap.Get("param1")}${CRLF}Param2: ${mmap.Get("param2")}${CRLF}"$
Dim xui As XUI
Dim sf As Object = xui.MsgboxAsync(msg, "WARNING")
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
'
End If