From ac6062c8cd820797fcaabccd42b6f3d246d65c71 Mon Sep 17 00:00:00 2001 From: brunonahornygaudium <161364183+brunonahornygaudium@users.noreply.github.com> Date: Thu, 5 Nov 2026 18:04:34 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20limpa=20som=20e=20vibra=C3=A7=C3=A3o=20d?= =?UTF-8?q?o=20update=20quando=20n=C3=A3o=20informados,=20evitando=20repet?= =?UTF-8?q?i=C3=A7=C3=A3o=20a=20cada=20atualiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/NotificationContent.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/NotificationContent.kt b/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/NotificationContent.kt index 9eb96ee..d2aa0f8 100644 --- a/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/NotificationContent.kt +++ b/android/src/main/kotlin/com/pravera/flutter_foreground_task/models/NotificationContent.kt @@ -189,9 +189,16 @@ data class NotificationContent( iconJsonString?.let { putString(PrefsKey.NOTIFICATION_CONTENT_ICON, it) } buttonsJsonString?.let { putString(PrefsKey.NOTIFICATION_CONTENT_BUTTONS, it) } initialRoute?.let { putString(PrefsKey.NOTIFICATION_INITIAL_ROUTE, it) } - sound?.let { putString(PrefsKey.NOTIFICATION_SOUND, it) } - vibratePattern?.let { - putString(PrefsKey.NOTIFICATION_VIBRATE_PATTERN, it) + // Som e vibração valem só para este update, como no iOS. + if (sound != null) { + putString(PrefsKey.NOTIFICATION_SOUND, sound) + } else { + remove(PrefsKey.NOTIFICATION_SOUND) + } + if (vibratePattern != null) { + putString(PrefsKey.NOTIFICATION_VIBRATE_PATTERN, vibratePattern) + } else { + remove(PrefsKey.NOTIFICATION_VIBRATE_PATTERN) } largeIconPath?.let { putString(PrefsKey.NOTIFICATION_LARGE_ICON_PATH, it)