Hi Alex,
Thank you kindly for your reply and your note regarding line #20.
I had a similar line to your line #20 already in my code. However I wish to avoid the user having to
press the notification.
Here is my full code for the MessageArrived code within the FirebaseMessaging service module:
Sub fm_MessageArrived (Message As RemoteMessage)
Log("Message arrived")
Log($"Message data: ${Message.GetData}"$)
Dim n As Notification
n.Initialize2(n.IMPORTANCE_HIGH)
n.Icon = "icon"
n.vibrate = True
n.AutoCancel = True
n.SetInfo(Message.GetData.Get("Title"), Message.GetData.Get("Body"), Main)
n.Notify(1)
CallSubDelayed3(Main, "MessageReceived", Message.GetData.Get("TxTopic"), Message.GetData.Get("Payload"))
End Sub
The help text for the SetInfo command states that "this activity will start when the user presses on that notification". What I am trying to achieve is way to start the Main activity so it can process my MessageReceived sub
without the user pressing anything.
The CallSubDelayed3 line does not seem to start the Main activity - it only seems to send a request that is queued.
Any help would be warmly appreciated.
- Ralph