Good day for everyone,
I have a strange problem here:
I create 2 apps (Android and iOS), both registered to receive notifications via Firebase Notifications.
When I send with this method:
working fine in Android in Foreground and Background, with no problem! Perfect
working fine in iOS in Foreground, BUT NO in background. :-(
BUT THE STRANGE THING IS: If I put the same topic or via package name in FireBase page, works, foreground and background, like this:
and works in background:
So, my question is: Whats the difference to send via method (https://fcm.googleapis.com/fcm/send) and send via Firebase page (https://console.firebase.google.com/u/0/project/xxxxxxxxxxxx)
and Yes, I have all settings in app like this:
Again: The push notifications VIA firebase page is working fine, but via Method NO
Thanks
I have a strange problem here:
I create 2 apps (Android and iOS), both registered to receive notifications via Firebase Notifications.
When I send with this method:
B4X:
Private Sub SendMessage(Topic As String, Title As String, Body As String)
Dim Job As HttpJob
Job.Initialize("fcm", Me)
Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)
Dim data As Map = CreateMap("title": Title, "body": Body)
m.Put("data", data)
Dim jg As JSONGenerator
jg.Initialize(m)
Job.PostString("https://fcm.googleapis.com/fcm/send", jg.ToString)
Job.GetRequest.SetContentType("application/json;charset=UTF-8")
Job.GetRequest.SetHeader("Authorization", "key=" & API_KEY)
End Sub
working fine in Android in Foreground and Background, with no problem! Perfect
working fine in iOS in Foreground, BUT NO in background. :-(
BUT THE STRANGE THING IS: If I put the same topic or via package name in FireBase page, works, foreground and background, like this:
and works in background:
So, my question is: Whats the difference to send via method (https://fcm.googleapis.com/fcm/send) and send via Firebase page (https://console.firebase.google.com/u/0/project/xxxxxxxxxxxx)
and Yes, I have all settings in app like this:
B4X:
#ProvisionFile: ProvDevelopxxxxxxx.mobileprovision
#CertificateFile: ios_development.cer
#Entitlement: <key>aps-environment</key><string>development</string>
#PlistExtra: <key>UIBackgroundModes</key><array><string>remote-notification</string></array>
Again: The push notifications VIA firebase page is working fine, but via Method NO
Thanks
Last edited: