mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
20 lines
523 B
Swift
20 lines
523 B
Swift
import ExpoModulesCore
|
|
import WidgetKit
|
|
|
|
public class WidgetBridgeModule: Module {
|
|
public func definition() -> ModuleDefinition {
|
|
Name("WidgetBridge")
|
|
|
|
Function("setWidgetData") { (key: String, value: String) in
|
|
let suite = UserDefaults(suiteName: "group.com.sauci.app")
|
|
suite?.set(value, forKey: key)
|
|
}
|
|
|
|
Function("reloadWidgets") {
|
|
if #available(iOS 14.0, *) {
|
|
WidgetCenter.shared.reloadAllTimelines()
|
|
}
|
|
}
|
|
}
|
|
}
|