Sub Process_Globals
Private fm As FirebaseMessaging
Private iconoNotificacion As Bitmap
End Sub
Sub Service_Create
fm.Initialize("fm")
iconoNotificacion = LoadBitmapResize(File.DirAssets, "logo.png", 36dip, 24dip, False)
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
' Dim n As Notification
' n.Initialize
' n.Icon = "notificacion"
' n.AutoCancel = True
' n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
' n.Notify(1)
Dim n As NB6
n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(iconoNotificacion)
n.Build(Message.GetData.Get("title"), Message.GetData.Get("body"), "tag1", Main).Notify(4) 'It will be Main (or any other activity) instead of Me if called from a service.
Service.StopAutomaticForeground 'remove if not using B4A v8+.
End Sub