about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/BlueskyNSE/NotificationService.swift7
-rw-r--r--modules/expo-background-notification-handler/android/src/main/java/expo/modules/backgroundnotificationhandler/BackgroundNotificationHandler.kt3
2 files changed, 6 insertions, 4 deletions
diff --git a/modules/BlueskyNSE/NotificationService.swift b/modules/BlueskyNSE/NotificationService.swift
index c6f391e00..e6aca99c1 100644
--- a/modules/BlueskyNSE/NotificationService.swift
+++ b/modules/BlueskyNSE/NotificationService.swift
@@ -6,7 +6,7 @@ class NotificationService: UNNotificationServiceExtension {
   var prefs = UserDefaults(suiteName: APP_GROUP)
 
   override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
-    guard var bestAttempt = createCopy(request.content),
+    guard let bestAttempt = createCopy(request.content),
           let reason = request.content.userInfo["reason"] as? String
     else {
       contentHandler(request.content)
@@ -15,11 +15,10 @@ class NotificationService: UNNotificationServiceExtension {
     
     if reason == "chat-message" {
       mutateWithChatMessage(bestAttempt)
+    } else {
+      mutateWithBadge(bestAttempt)
     }
     
-    // The badge should always be incremented when in the background
-    mutateWithBadge(bestAttempt)
-    
     contentHandler(bestAttempt)
   }
   
diff --git a/modules/expo-background-notification-handler/android/src/main/java/expo/modules/backgroundnotificationhandler/BackgroundNotificationHandler.kt b/modules/expo-background-notification-handler/android/src/main/java/expo/modules/backgroundnotificationhandler/BackgroundNotificationHandler.kt
index 344508523..0a8737b88 100644
--- a/modules/expo-background-notification-handler/android/src/main/java/expo/modules/backgroundnotificationhandler/BackgroundNotificationHandler.kt
+++ b/modules/expo-background-notification-handler/android/src/main/java/expo/modules/backgroundnotificationhandler/BackgroundNotificationHandler.kt
@@ -35,5 +35,8 @@ class BackgroundNotificationHandler(
         remoteMessage.data["sound"] = null
       }
     }
+
+    // TODO - Remove this once we have more backend capability
+    remoteMessage.data["badge"] = null
   }
 }