paho.mqtt.android icon indicating copy to clipboard operation
paho.mqtt.android copied to clipboard

Notification is not removing.

Open himanshu-my opened this issue 3 years ago • 2 comments

I have attached a notification when starting the service like below

mqttClient!!.setForegroundService(notification.build(), notificationId)

Now my issue is when I disconnect and close the mqtt connection still notification not removed from the status bar. Please suggest how can I remove that notification after mqtt disconnection.

I have used

val notificationManager = NotificationManagerCompat.from(context) notificationManager.cancel(notificationId)

and

val notificationManager = MyApp.appContext. getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager notificationManager.cancel(notificationId)

this as well on mqtt disconnect, but still notification is not removing. 

himanshu-my avatar Dec 02 '21 12:12 himanshu-my

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!

stale[bot] avatar Jan 07 '23 20:01 stale[bot]

Sorry for the late response. Please use https://github.com/hannesa2/paho.mqtt.android/releases/tag/3.6.0-beta7 and please tell me, how it works after several connect/disconnect. I didn't tested this.

hannesa2 avatar Apr 11 '23 06:04 hannesa2