M miling Member May 29, 2023 #1 Hi How can I create a notification with a big image using a library: https://www.b4x.com/android/forum/threads/nb6-notifications-builder.91819/#content which when clicked run a service without bringing up any activity?
Hi How can I create a notification with a big image using a library: https://www.b4x.com/android/forum/threads/nb6-notifications-builder.91819/#content which when clicked run a service without bringing up any activity?
Erel B4X founder Staff member Licensed User Longtime User May 30, 2023 #2 You can start the service from the activity and immediately close the activity. You cannot start a service from the default notification click. Upvote 0
You can start the service from the activity and immediately close the activity. You cannot start a service from the default notification click.
M miling Member May 30, 2023 #3 I wrote this code in Receiver module in fm_MessageArrived function B4X: Copy Dim n2 As Notification n2.Initialize2(n2.IMPORTANCE_DEFAULT) n2.Icon = "icon" n2.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Notif) n2.Notify(1) But when I click on the notification, instead of the Notif activity, my first activity comes up and the notification commands do not work properly. But when the application is up and I click on the notification, the Notif activity comes up.... what is the problem? Upvote 0
I wrote this code in Receiver module in fm_MessageArrived function B4X: Copy Dim n2 As Notification n2.Initialize2(n2.IMPORTANCE_DEFAULT) n2.Icon = "icon" n2.SetInfo(Message.GetData.Get("title"), Message.GetData.Get("body"), Notif) n2.Notify(1) But when I click on the notification, instead of the Notif activity, my first activity comes up and the notification commands do not work properly. But when the application is up and I click on the notification, the Notif activity comes up.... what is the problem?
Erel B4X founder Staff member Licensed User Longtime User May 31, 2023 #4 Better to start the Main activity and then check the notification_tag (SetInfo2). Upvote 0