M mauro vicamini Active Member Licensed User Longtime User Nov 20, 2015 #1 Hi everyone! I've this problem: When I recive a Remote Notification I create the Notification like this in my pushService service: Code: Copy If Not(n.IsInitialized) Then n.Initialize End If n.AutoCancel = True n.Icon = "icon" n.Sound = True n.Number = cNot n.OnGoingEvent = False n.SetInfo( "Requests", "There are " & cNot & " requests ", Notify) n.Notify(1) (note: n is in the Process_Globals of pushService service, cNot is only a counter to show how may requests I've recived) All works great and when I click on the icon in the notification bar it starts my application and the icon disappear. The problem is when I'm already in my application in an activity different from Notify and I click on the icon it doesn't desappears even if in the Activity_Resume I've this code: Code: Copy pushService.n.Cancel(1) I've noted one thing: in the first case the notification is displayed outside the OnGoing section. In the second case it's displayed in the OnGoing section. How can I cancel the icon from the notification bar in all conditions? Thanks for the attention.
Hi everyone! I've this problem: When I recive a Remote Notification I create the Notification like this in my pushService service: Code: Copy If Not(n.IsInitialized) Then n.Initialize End If n.AutoCancel = True n.Icon = "icon" n.Sound = True n.Number = cNot n.OnGoingEvent = False n.SetInfo( "Requests", "There are " & cNot & " requests ", Notify) n.Notify(1) (note: n is in the Process_Globals of pushService service, cNot is only a counter to show how may requests I've recived) All works great and when I click on the icon in the notification bar it starts my application and the icon disappear. The problem is when I'm already in my application in an activity different from Notify and I click on the icon it doesn't desappears even if in the Activity_Resume I've this code: Code: Copy pushService.n.Cancel(1) I've noted one thing: in the first case the notification is displayed outside the OnGoing section. In the second case it's displayed in the OnGoing section. How can I cancel the icon from the notification bar in all conditions? Thanks for the attention.
Erel B4X founder Staff member Licensed User Longtime User Nov 22, 2015 #2 Are you sure that you are not calling Service.StartForeground somewhere? Upvote 0