Sub Process_Globals
Private fm As FirebaseMessaging
End Sub
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
If FirstTime Then
fm.Initialize("fm")
End If
fm.HandleIntent(StartingIntent)
End Sub
Public Sub SubscribeToTopics
fm.SubscribeToTopic("general")
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
' Dim n As Notification
' n.Initialize2(n.IMPORTANCE_DEFAULT)
'
' n.AutoCancel = True
' n.Icon = "icon_notif"
' n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
'
' n.Notify(1)
Private smiley As Bitmap
smiley = LoadBitmapResize(File.DirAssets, "home.png", 24dip, 24dip, False)
Dim n2 As NB6
n2.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(smiley)
n2.Build(Message.GetData.Get("title"), Message.GetData.Get("body"), "tag1", Main).Notify(1) 'It will be Main (or any other activity) instead of Me if called from a service.
End Sub
Sub fm_TokenRefresh (Token As String)
Log("Token : " & Token)
End Sub