From ddbed6b67c331f0b73bdbd7cea152db37127e998 Mon Sep 17 00:00:00 2001 From: Ross Savage <551697+dangeross@users.noreply.github.com> Date: Mon, 17 Mar 2025 15:04:28 +0100 Subject: [PATCH] Dismiss replaceable notifications on service shutdown (#777) --- .../kotlin/breez_sdk_liquid_notification/ForegroundService.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/bindings/langs/android/lib/src/main/kotlin/breez_sdk_liquid_notification/ForegroundService.kt b/lib/bindings/langs/android/lib/src/main/kotlin/breez_sdk_liquid_notification/ForegroundService.kt index 5291084..a8e2f17 100644 --- a/lib/bindings/langs/android/lib/src/main/kotlin/breez_sdk_liquid_notification/ForegroundService.kt +++ b/lib/bindings/langs/android/lib/src/main/kotlin/breez_sdk_liquid_notification/ForegroundService.kt @@ -15,9 +15,11 @@ import breez_sdk_liquid_notification.Constants.MESSAGE_TYPE_LNURL_PAY_INFO import breez_sdk_liquid_notification.Constants.MESSAGE_TYPE_LNURL_PAY_INVOICE import breez_sdk_liquid_notification.Constants.MESSAGE_TYPE_SWAP_UPDATED import breez_sdk_liquid_notification.Constants.NOTIFICATION_ID_FOREGROUND_SERVICE +import breez_sdk_liquid_notification.Constants.NOTIFICATION_ID_REPLACEABLE import breez_sdk_liquid_notification.Constants.SERVICE_TIMEOUT_MS import breez_sdk_liquid_notification.Constants.SHUTDOWN_DELAY_MS import breez_sdk_liquid_notification.NotificationHelper.Companion.notifyForegroundService +import breez_sdk_liquid_notification.NotificationHelper.Companion.cancelNotification import breez_sdk_liquid_notification.job.Job import breez_sdk_liquid_notification.job.LnurlPayInfoJob import breez_sdk_liquid_notification.job.LnurlPayInvoiceJob @@ -97,6 +99,7 @@ abstract class ForegroundService : open fun shutdown() { logger.log(TAG, "Shutting down foreground service", "DEBUG") + cancelNotification(applicationContext, NOTIFICATION_ID_REPLACEABLE) stopForeground(STOP_FOREGROUND_REMOVE) stopSelf() }