Sub Process_Globals
Private fm As FirebaseMessaging
Dim DEVICE As String
Dim MENSAGEM As String
Dim n As Notification
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
DEVICE = Message.GetData.Get("title")
DEVICE = DEVICE.SubString(8)
MENSAGEM = Message.GetData.Get("body")
Notif.device = DEVICE 'to the notification activity
Notif.temper = MENSAGEM
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.SetInfo(DEVICE, MENSAGEM, Notif)
n.Notify(1)
End Sub
Sub Service_Destroy
n.Cancel(1)
End Sub