finish android impl
This commit is contained in:
+17
-7
@@ -29,11 +29,7 @@ class ExpoBackgroundNotificationHandlerModule : Module() {
|
|||||||
if (Preferences(context).hasValue(key)) {
|
if (Preferences(context).hasValue(key)) {
|
||||||
return@forEach
|
return@forEach
|
||||||
}
|
}
|
||||||
|
Preferences(context)._setAnyValue(key, value)
|
||||||
Preferences(context)._(key, value)
|
|
||||||
|
|
||||||
when (value) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +41,22 @@ class ExpoBackgroundNotificationHandlerModule : Module() {
|
|||||||
isForegrounded = false
|
isForegrounded = false
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("setBadgeCountAsync") { _: String, _: Int ->
|
AsyncFunction("getPrefsAsync") {
|
||||||
// This does nothing on Android
|
val context = appContext.reactContext ?: throw Error("Context is null")
|
||||||
|
val keys = DEFAULTS.keys
|
||||||
|
return@AsyncFunction Preferences(context).getValues(keys)
|
||||||
|
}
|
||||||
|
|
||||||
|
AsyncFunction("resetGenericCountAsync") {
|
||||||
|
// Not implemented
|
||||||
|
}
|
||||||
|
|
||||||
|
AsyncFunction("maybeIncrementMessagesCountAsync") {
|
||||||
|
// Not implemented
|
||||||
|
}
|
||||||
|
|
||||||
|
AsyncFunction("maybeDecrementMessagesCountAsync") {
|
||||||
|
// Not implemented
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -37,6 +37,11 @@ public class ExpoBackgroundNotificationHandlerModule: Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AsyncFunction("getPrefsAsync") {
|
||||||
|
let keys = Array(DEFAULTS.keys)
|
||||||
|
return SharedPrefs.shared.getValues(keys)
|
||||||
|
}
|
||||||
|
|
||||||
AsyncFunction("resetGenericCountAsync") {
|
AsyncFunction("resetGenericCountAsync") {
|
||||||
SharedPrefs.shared.setValue(BadgeType.generic.toKeyName(), 0)
|
SharedPrefs.shared.setValue(BadgeType.generic.toKeyName(), 0)
|
||||||
}
|
}
|
||||||
@@ -66,11 +71,6 @@ public class ExpoBackgroundNotificationHandlerModule: Module {
|
|||||||
SharedPrefs.shared.setValue(BadgeType.messages.toKeyName(), count)
|
SharedPrefs.shared.setValue(BadgeType.messages.toKeyName(), count)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("getPrefsAsync") {
|
|
||||||
let keys = Array(DEFAULTS.keys)
|
|
||||||
return SharedPrefs.shared.getValues(keys)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user