iOS Question Disable Firebase Notification

German Buchmuller

Member
Licensed User
Hi, I implemented Firebase notifications and worked great. The problem that I have, is that some of the push messages recieved must be shown as a notification, but some others no. How can I make this? All messages recieved will show a notification. Thanks!

Edit:
By changing the send code:
B4X:
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)
    If Topic.StartsWith("ios_") Then
        Dim iosalert As Map =  CreateMap("title": Title, "body": Body, "sound": "default")
        'm.Put("notification", iosalert)
        m.Put("priority", 10)
        m.Put("content_available", True) '<--- add
    End If
    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)
 
Last edited:
Top