I inserted the code offered as an example in my application so I can receive push notifications. If the application is in Foreground, the notifications come immediately. If the application is in the Background (even without being closed), the notifications do not reach and are obviously not displayed on the screen. If the application reaches Foreground again, the notifications arrive and the message with their content is displayed. Do you have any idea what's wrong?
B4X:
Private Sub fm_FCMConnected
Log("FCMConnected")
fm.SubscribeToTopic("ios_90796f14-7c14-4ce5-ac7e-dfd183ea7a59")
End Sub
Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler)
Log($"Message arrived: ${Message}"$)
Msgbox(Message, "Push message!")
CompletionHandler.Complete
End Sub
Private Sub Application_Active
fm.FCMConnect 'should be called from Application_Active
End Sub
Private Sub Application_Background
fm.FCMDisconnect 'should be called from Application_Background
End Sub
Sub Application_PushToken (Success As Boolean, Token() As Byte)
Log($"PushToken: ${Success}"$)
Log(LastException)
End Sub