Ive got notifications being received by my B4i app and I'm putting them into a list that I store, however I'm unable to have a notification pop up like in the android app.
Following is the code thats working in the Android app;
FirebaseMessaging:
Sub fm_MessageArrived (Message As RemoteMessage)
If B4XPages.IsInitialized And B4XPages.GetManager.IsForeground Then
Log("App is in the foreground. In iOS a notification will not appear while the app is in the foreground (unless UserNotificationCenter is used).")
End If
Dim n2 As Notification
n2.Initialize2(n2.IMPORTANCE_HIGH)
n2.Icon = "icon"
n2.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
n2.Notify(1)
End Sub
I have tried to get a similar thing going in B4i with the following code, which throws no errors but doesnt notify;
FirebaseMessaging:
Public Sub MessageReceivedWhileInTheForeground (Message As Map)
Dim aps As Map = Message.Get("aps")
Dim alert As Map = aps.Get("alert")
Dim n2 As Notification
n2.Initialize(1)
n2.PlaySound = True
n2.AlertBody = alert.Get("body")
n2.NotificationTag = alert.Get("title")
End Sub
As said earlier, I am receiving the push message and can store it in a list of maps, but no sound or message pops up.