Strange firebase behavior.
When I send a message from IOS using this code,
it always comes to android. But after a few messages, it is still being sent to android, but not arriving to IOS. From android it is sent to android and several messages to iOS (after which messages stop arriving). Method Application_RemoteNotification is not called.
Moreover, if after the messages stop arriving, I minimize the application and maximize it again, then the next message will come to the IOS too.
If the application is turned on for some time, then ios will be able to receive several messages again.
A very strange problem.
When I send a message from IOS using this code,
B4X:
Private Sub SendMessage(Topic As String, data As Map)
Log("MyTopic ------------> "& Topic)
Dim Job As HttpJob
Job.Initialize("fcm", Me)
Dim m As Map = CreateMap("to": $"/topics/${Topic}"$)
If Topic.StartsWith("ios_") Then
m.Put("content_available", True)
m.Put("priority", 10)
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=" & WebApiKey)
End Sub
it always comes to android. But after a few messages, it is still being sent to android, but not arriving to IOS. From android it is sent to android and several messages to iOS (after which messages stop arriving). Method Application_RemoteNotification is not called.
Moreover, if after the messages stop arriving, I minimize the application and maximize it again, then the next message will come to the IOS too.
If the application is turned on for some time, then ios will be able to receive several messages again.
A very strange problem.