Push notifications (using Firebase) is only working for me when the app is in the foreground. Application_PushToken fires as expected. When I go to the home screen and send a notification to my app nothing happens, there is no indication from the OS that there is a notification. When I then open the app the notifications come though again.
I've tried Debug and Release mode.
I've got this in #Region:
I've got this in Application_Start:
In Android I had to do this in fm_MessageArrived to create a notification on the status bar:
But it seems on iOS the OS does it automatically if I read the threads correctly. Or am I wrong?
I tried adding this to Application_RemoteNotification:
But that only seems to fire Application_ReceiveLocalNotification when the app is in the foreground and there is nothing on the OS status bar.
What am I missing?
I've tried Debug and Release mode.
I've got this in #Region:
B4X:
#PlistExtra: <key>UIBackgroundModes</key><array><string>remote-notification</string></array>
I've got this in Application_Start:
B4X:
App.RegisterUserNotifications(True, True, True)
App.RegisterForRemoteNotifications
In Android I had to do this in fm_MessageArrived to create a notification on the status bar:
B4X:
n.Initialize
n.Icon = "icon"
n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("message"), Main)
n.Notify(1)
But it seems on iOS the OS does it automatically if I read the threads correctly. Or am I wrong?
I tried adding this to Application_RemoteNotification:
B4X:
Dim n As Notification
n.Initialize(DateTime.Now)
n.AlertBody = Message.Get("title") & " - " & Message.Get("message")
n.PlaySound = True
n.Register
But that only seems to fire Application_ReceiveLocalNotification when the app is in the foreground and there is nothing on the OS status bar.
What am I missing?