Hi
I need to disable notifications when I press on a CheckBox1
Module Main
I would like to check the arrival of the message through Checked but I can not recover it,
how could I do?
thank you
Service FirebaseMessaging
I need to disable notifications when I press on a CheckBox1
Module Main
B4X:
Sub CheckBox1_CheckedChange(Checked As Boolean)
Log(Checked)
End Sub
I would like to check the arrival of the message through Checked but I can not recover it,
how could I do?
thank you
Service FirebaseMessaging
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ID ${Message.MessageId}, Data ${Message.GetData}"$)
Log("Message="& Message)
Dim map As Map :map.Initialize
map = CreateMap("body2":Message.GetData.Get("body"),"title1":Message.GetData.Get("title"))
For Each key As String In map.Keys
Dim value As String = map.Get(key)
Log($"${key}:${value}"$)
Next
If CallSub2(Main,"CheckBox1_CheckedChange",Message)=True Then '<------------------
'message does not arrive '<------------------
Else '<------------------
Dim jgen As JSONGenerator
jgen.Initialize(map)
Dim n As NB6
mano = LoadBitmapResize(File.DirAssets, "mano.png", 24dip, 24dip, False)
n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(mano)
n.Build(Message.GetData.Get("title"), Message.GetData.Get("body"), jgen.ToString, Main).Notify(4)
End If
End Sub