Skip to content
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 #469

Open
Monika-Paliwal opened this issue Dec 14, 2021 · 1 comment

Comments

@Monika-Paliwal
Copy link

We have added the notification in mqtt for show the notification in notification bar but when we kill the app or logout the app the notification still showing in notification bar.
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.because

@dipu989
Copy link

dipu989 commented Feb 7, 2022

Try to stop the service as foreground service comes with a notification. If service is stopped, the notification will go away!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants