Android Question Clicking the notification only opens the app when the app has been manually opened at least once.

Alankoba

Member
Licensed User
Firebase Push messages


B4X:
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


Lib FireBaseNotifications: 1.21
B4A Versions: 9.50 BETA 1, 9.30 Stable
 

Alankoba

Member
Licensed User
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
 

Alankoba

Member
Licensed User
After 45 seconds of clicking (approximate time) the app opens correctly. Can this be something with the foreground?
 

OliverA

Expert
Licensed User
Top