Hello Sir,
I am beginning to use firebase notifications in my app. My code is...
#Region Service Attributes
#StartAtBoot: False
#End Region
<!------------ Process_Globals starts------------------------->
Sub Process_Globals
Private fm As FirebaseMessaging
Public MyFCMToken As String
Public FCM_KEY As String = ""
Public MyName As String ="Suruchi"
End Sub
<!------------ Recieving token------------------------->
Sub Service_Create
<!---------------Service_Start------------------------->
Sub Service_Start (StartingIntent As Intent)
<!---------------for receiving notification------------------------->
Sub fm_MessageArrived (Message As RemoteMessage)
It works well but in notification tray, null value is shown because Message.GetData.Get("title") gives null value. Why this happen?
I am beginning to use firebase notifications in my app. My code is...
#Region Service Attributes
#StartAtBoot: False
#End Region
<!------------ Process_Globals starts------------------------->
Sub Process_Globals
Private fm As FirebaseMessaging
Public MyFCMToken As String
Public FCM_KEY As String = ""
Public MyName As String ="Suruchi"
End Sub
<!------------ Recieving token------------------------->
Sub Service_Create
fm.Initialize("fm")
MyFCMToken=fm.Token
Log (MyFCMToken)
End SubMyFCMToken=fm.Token
Log (MyFCMToken)
<!---------------Service_Start------------------------->
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.IsInitialized And fm.HandleIntent(StartingIntent) Then Return
End Sub<!---------------for receiving notification------------------------->
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData.Get("title")}"$)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.Vibrate=True
n.Sound=True
n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
n.Notify(1)
End SubLog($"Message data: ${Message.GetData.Get("title")}"$)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.Vibrate=True
n.Sound=True
n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Main)
n.Notify(1)
It works well but in notification tray, null value is shown because Message.GetData.Get("title") gives null value. Why this happen?
Last edited: