Dear Team,
I facing two problems with Firebase Notification,
1st Problem
Firebase notification is only happening if my application is in background working mode, ie, If I am in my App, I am not receiving any notification.
2nd Problem
I have defined newMessage as global variable and in FireBaseMessaging module I have code as below where I have set newMessage as True,
Now my problem if I access this variable from Main Module, its value still false even after notification message. My requirement isto set this variable trueif any notification arrives, I also tried to save this value in a text file upon receiving notification that also not working.
Please support me on this, thanks in advance.
I facing two problems with Firebase Notification,
1st Problem
Firebase notification is only happening if my application is in background working mode, ie, If I am in my App, I am not receiving any notification.
2nd Problem
I have defined newMessage as global variable and in FireBaseMessaging module I have code as below where I have set newMessage as True,
Now my problem if I access this variable from Main Module, its value still false even after notification message. My requirement isto set this variable trueif any notification arrives, I also tried to save this value in a text file upon receiving notification that also not working.
Please support me on this, thanks in advance.
B4X:
Sub Process_Globals
Dim newMessage As Boolean
newMessage = false
End Sub
Sub fm_MessageArrived (Message As RemoteMessage)
Dim n As Notification
If Message.GetData == Null Or Message.GetData.Get("title") == Null Then
Return
End If
n.Initialize
n.Icon = "icon"
n.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body") , Main)
Main.newMessage=True
n.Notify(1)
End Sub