#Region Service Attributes
#StartAtBoot: true
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private fm As FirebaseMessaging
Public mess As String
End Sub
Sub Service_Create
fm.Initialize("fm")
End Sub
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.IsInitialized And fm.HandleIntent(StartingIntent) Then Return
End Sub
Sub Service_Destroy
End Sub
Public Sub SubscribeToTopics
fm.SubscribeToTopic("general") 'you can subscribe to more topics
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
mess = Message.GetData.Get("body")
Dim n As Notification
n.Initialize
n.Icon = "icon"
' n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
n.SetInfo2(Message.GetData.Get("title"), Message.GetData.Get("body"),"Notification_Tag", Main)
n.Notify(1)
End Sub