add support for mark-read-generic and mark-read-messages
update kotlin stub update js types update the correct badge count clamp single decrements too clamp decrement future proof with `decrementBy` add support for `mark-read-generic` and `mark-read-messages` do nothing when receiving `mark-read-*` is received simplify swift update android with new types add types to `NotificationReason` add logic for decrementing the badge add decrement mutation
This commit is contained in:
+16
-2
@@ -114,8 +114,22 @@ public class ExpoBackgroundNotificationHandlerModule: Module {
|
||||
}
|
||||
}
|
||||
|
||||
AsyncFunction("setBadgeCountAsync") { (count: Int) in
|
||||
userDefaults?.setValue(count, forKey: "badgeCount")
|
||||
AsyncFunction("setBadgeCountAsync") { (type: BadgeCountType, count: Int) in
|
||||
userDefaults?.setValue(count, forKey: type.toKeyName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum BadgeCountType : String, Enumerable {
|
||||
case generic
|
||||
case messages
|
||||
|
||||
func toKeyName() -> String {
|
||||
switch self {
|
||||
case .generic:
|
||||
return "badgeCountGeneric"
|
||||
case .messages:
|
||||
return "badgeCountMessages"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user