#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
Private fm As FirebaseMessaging
'Private KVS As KeyValueStore
'Private xui As XUI
End Sub
Sub Service_Create
fm.Initialize("fm")
End Sub
Public Sub SubscribeToTopics
'fm.SubscribeToTopic("general") 'you can subscribe to more topics
End Sub
Sub Service_Start (StartingIntent As Intent)
' xui.SetDataFolder("kvs")
' KVS.Initialize(xui.DefaultFolder, "kvs.dat")
' If KVS.Get("BildirimlerAcik") <> Null Then
' If KVS.Get("BildirimlerAcik") Then
' If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
' Sleep(0)
' Service.StopAutomaticForeground 'remove if not using B4A v8+.
' Else
' StopService(Me)
' End If
' Else
' KVS.Put("BildirimlerAcik", True)
' End If
' KVS.Close
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
' Log("Message arrived")
' Log($"Message data: ${Message.GetData}"$)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.AutoCancel = True
n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
n.Notify(1)
End Sub
public Sub Service_Destroy
End Sub