Private Sub SendMessage(Topic As String, Title As String, Body As String)
Try
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)
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)
Catch
End Try
End Sub