-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notification is not removing when we set setForegroundService in mqtt client #258
Comments
I guess you have to do something like this https://stackoverflow.com/a/35721582/1079990 |
No, We are using below mentioned code in kotlin class so need a solution for stop mqttClient service |
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you! |
Sorry for the late response. |
still have issue of this , removing notification after disconnect |
Hey Hannes, I searched for an already working solution to remove the foreground notification for the 3.x versions. |
Hi, you mean we should apply #560 on 3.x branch as well ? To be honest, I would put afford to 4.x. May I ask you, why you still using 3.x ? |
Yes, that's what I meant. But just the changes from #560 would not be enough to work completely fine. Sure, I rely on receiving messages and displaying notifications while the device is asleep and currently this is only working well on the 3.x versions. On the 4.x versions (with started foreground service) the connection will be lost after a few minutes and it won't reconnect while the device is asleep. (Also tested with the extendedSample from 4.2.4) |
Found out that #560 already works fine (only in the extendedSample something seemed to be missing). |
Here is the release https://github.com/hannesa2/paho.mqtt.android/releases/tag/3.6.4
I'm looking forward for your help |
@NinaTietje |
We have added the notification in mqtt for show the notification in notification bar but when we logout the app the notification bar still showing.
We have used below mentioned code.
mqttClient!!.setForegroundService(notification.build(), notificationId)
And also used code for cancel notification
val notificationManager = context getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager notificationManager.cancel(notificationId)
Can you please provide the solution for stop the foreground service.
The text was updated successfully, but these errors were encountered: