You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
481 B

import ExpoModulesCore
import WebKit
public class ConstantsModule: Module {
private lazy var constants = appContext?.constants?.constants() as? [String: Any] ?? [:]
public func definition() -> ModuleDefinition {
Name("ExponentConstants")
Constants {
return constants
}
AsyncFunction("getWebViewUserAgentAsync") { () -> String? in
let webView = WKWebView()
return webView.value(forKey: "userAgent") as? String
}.runOnQueue(.main)
}
}