Sub Service_Start (StartingIntent As Intent)
If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
Sleep(0) ' i Testet whitout this line
Service.StopAutomaticForeground 'remove if not using B4A v8+.
End Sub
Firebase creates a notification automatically, even without any code in fm_MessageArrived. When the app is open (showing on screen) then the fm_MessageArrived event is fired, and a msgBox is displayed.
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
CallSub3(Main, "msgPush", Message.GetData.Get("title"), Message.GetData.Get("body"))
End Sub