fix: apply system color scheme for iOS in auto theme mode, closes #1762 (#1767)

This commit is contained in:
Huang Xin 2025-08-08 19:45:04 +08:00 committed by GitHub
parent f2f744a2fe
commit f46be89036
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 156 additions and 29 deletions

View file

@ -533,6 +533,12 @@ class NativeBridgePlugin: Plugin {
invoke.resolve(["purchases": restored])
}
}
@objc public func get_system_color_scheme(_ invoke: Invoke) {
let userInterfaceStyle = UITraitCollection.current.userInterfaceStyle
let colorScheme = (userInterfaceStyle == .dark) ? "dark" : "light"
invoke.resolve(["colorScheme": colorScheme])
}
}
@_cdecl("init_plugin_native_bridge")