I note that there was an unanswered post about this very same question back in August.
I have both the PaushExample and my own App working fine in B4i, but both resuse to receive any messages in B4a.
It has the correct json file, as it wouldnt compile until i setup on the firebase site and downloaded. It seems to subscribe correctly, but when I send using the B4j app, I receive on the iPhone, but not the Android
Previously (more than a year ago) I had the old messaging working fine on a number of Android apps, but did have some difficulties with IOS.
Any help is much appreciated.
Kev
I have both the PaushExample and my own App working fine in B4i, but both resuse to receive any messages in B4a.
It has the correct json file, as it wouldnt compile until i setup on the firebase site and downloaded. It seems to subscribe correctly, but when I send using the B4j app, I receive on the iPhone, but not the Android
B4X:
Sub Process_Globals
Private fm As FirebaseMessaging
End Sub
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
If FirstTime Then
fm.Initialize("fm")
End If
fm.HandleIntent(StartingIntent)
End Sub
Public Sub SubscribeToTopics (Topics() As Object)
For Each topic As String In Topics
fm.SubscribeToTopic(topic)
Log("SUBSCRIBED: "&topic)
Next
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
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
Sub fm_TokenRefresh (Token As String)
Log("TokenRefresh: " & Token)
End Sub
Previously (more than a year ago) I had the old messaging working fine on a number of Android apps, but did have some difficulties with IOS.
Any help is much appreciated.
Kev
Last edited: