mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
Catch-up pages called the native ledger once per dismissal, each call re-reading, encoding and writing the full 24h UserDefaults ledger. A new rememberAll bridge merges a whole page in one locked read/encode/write with identical semantics (max seq per identity, refreshed 24h expiry).
15 lines
552 B
Swift
15 lines
552 B
Swift
import ExpoModulesCore
|
|
|
|
public class OrcaNotificationDismissalModule: Module {
|
|
public func definition() -> ModuleDefinition {
|
|
Name("OrcaNotificationDismissal")
|
|
AsyncFunction("rememberAll") { (payloads: [[String: Any]]) in
|
|
PushDismissalLedger.shared.remember(payloads.compactMap(PushDismissalIdentity.init))
|
|
}
|
|
AsyncFunction("wasDismissed") { (payload: [String: Any]) -> Bool in
|
|
guard let identity = PushDismissalIdentity(payload) else { return false }
|
|
return PushDismissalLedger.shared.contains(identity)
|
|
}
|
|
}
|
|
}
|