From 480a40862f329f98a37772f01fd774d0e6d89a9e Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 7 Jun 2024 15:15:33 -0700 Subject: Use the proper logic on iOS to increment the badge (#4233) --- .../ios/ExpoBackgroundNotificationHandlerModule.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/expo-background-notification-handler/ios/ExpoBackgroundNotificationHandlerModule.swift') diff --git a/modules/expo-background-notification-handler/ios/ExpoBackgroundNotificationHandlerModule.swift b/modules/expo-background-notification-handler/ios/ExpoBackgroundNotificationHandlerModule.swift index 08972a04c..5f8c7fc3b 100644 --- a/modules/expo-background-notification-handler/ios/ExpoBackgroundNotificationHandlerModule.swift +++ b/modules/expo-background-notification-handler/ios/ExpoBackgroundNotificationHandlerModule.swift @@ -10,7 +10,8 @@ let DEFAULTS: [String:Any] = [ "playSoundQuote": false, "playSoundReply": false, "playSoundRepost": false, - "mutedThreads": [:] as! [String:[String]] + "mutedThreads": [:] as! [String:[String]], + "badgeCount": 0, ] /* @@ -112,5 +113,9 @@ public class ExpoBackgroundNotificationHandlerModule: Module { userDefaults?.setValue(curr, forKey: forKey) } } + + AsyncFunction("setBadgeCountAsync") { (count: Int) in + userDefaults?.setValue(count, forKey: "badgeCount") + } } } -- cgit 1.4.1