@capacitor-plus/ios 8.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Capacitor/Capacitor/AppUUID.swift +51 -0
- package/Capacitor/Capacitor/Array+Capacitor.swift +31 -0
- package/Capacitor/Capacitor/CAPApplicationDelegateProxy.swift +32 -0
- package/Capacitor/Capacitor/CAPBridge.swift +25 -0
- package/Capacitor/Capacitor/CAPBridgeDelegate.swift +6 -0
- package/Capacitor/Capacitor/CAPBridgeProtocol.swift +148 -0
- package/Capacitor/Capacitor/CAPBridgeViewController+CDVScreenOrientationDelegate.h +6 -0
- package/Capacitor/Capacitor/CAPBridgeViewController+CDVScreenOrientationDelegate.m +5 -0
- package/Capacitor/Capacitor/CAPBridgeViewController.swift +384 -0
- package/Capacitor/Capacitor/CAPBridgedJSTypes.h +18 -0
- package/Capacitor/Capacitor/CAPBridgedJSTypes.m +43 -0
- package/Capacitor/Capacitor/CAPBridgedPlugin+getMethod.swift +13 -0
- package/Capacitor/Capacitor/CAPBridgedPlugin.h +41 -0
- package/Capacitor/Capacitor/CAPFile.swift +14 -0
- package/Capacitor/Capacitor/CAPInstanceConfiguration.h +38 -0
- package/Capacitor/Capacitor/CAPInstanceConfiguration.m +93 -0
- package/Capacitor/Capacitor/CAPInstanceConfiguration.swift +78 -0
- package/Capacitor/Capacitor/CAPInstanceDescriptor.h +167 -0
- package/Capacitor/Capacitor/CAPInstanceDescriptor.m +56 -0
- package/Capacitor/Capacitor/CAPInstanceDescriptor.swift +198 -0
- package/Capacitor/Capacitor/CAPInstancePlugin.swift +10 -0
- package/Capacitor/Capacitor/CAPLog.swift +11 -0
- package/Capacitor/Capacitor/CAPNotifications.swift +69 -0
- package/Capacitor/Capacitor/CAPPlugin+LoadInstance.swift +20 -0
- package/Capacitor/Capacitor/CAPPlugin.h +60 -0
- package/Capacitor/Capacitor/CAPPlugin.m +180 -0
- package/Capacitor/Capacitor/CAPPluginCall.h +25 -0
- package/Capacitor/Capacitor/CAPPluginCall.m +36 -0
- package/Capacitor/Capacitor/CAPPluginCall.swift +97 -0
- package/Capacitor/Capacitor/CAPPluginMethod.h +36 -0
- package/Capacitor/Capacitor/CAPPluginMethod.m +44 -0
- package/Capacitor/Capacitor/CAPPluginMethod.swift +17 -0
- package/Capacitor/Capacitor/Capacitor.h +15 -0
- package/Capacitor/Capacitor/Capacitor.modulemap +8 -0
- package/Capacitor/Capacitor/CapacitorBridge.swift +768 -0
- package/Capacitor/Capacitor/CapacitorExtension.swift +24 -0
- package/Capacitor/Capacitor/Codable/JSValueDecoder.swift +479 -0
- package/Capacitor/Capacitor/Codable/JSValueEncoder.swift +671 -0
- package/Capacitor/Capacitor/Data+Capacitor.swift +22 -0
- package/Capacitor/Capacitor/DocLinks.swift +8 -0
- package/Capacitor/Capacitor/Info.plist +24 -0
- package/Capacitor/Capacitor/JS.swift +122 -0
- package/Capacitor/Capacitor/JSExport.swift +218 -0
- package/Capacitor/Capacitor/JSTypes.swift +254 -0
- package/Capacitor/Capacitor/KeyPath.swift +60 -0
- package/Capacitor/Capacitor/KeyValueStore.swift +303 -0
- package/Capacitor/Capacitor/NotificationHandlerProtocol.swift +6 -0
- package/Capacitor/Capacitor/NotificationRouter.swift +60 -0
- package/Capacitor/Capacitor/PluginCallResult.swift +106 -0
- package/Capacitor/Capacitor/PluginConfig.swift +56 -0
- package/Capacitor/Capacitor/Plugins/CapacitorCookieManager.swift +141 -0
- package/Capacitor/Capacitor/Plugins/CapacitorCookies.swift +57 -0
- package/Capacitor/Capacitor/Plugins/CapacitorHttp.swift +57 -0
- package/Capacitor/Capacitor/Plugins/CapacitorUrlRequest.swift +225 -0
- package/Capacitor/Capacitor/Plugins/Console.swift +16 -0
- package/Capacitor/Capacitor/Plugins/HttpRequestHandler.swift +236 -0
- package/Capacitor/Capacitor/Plugins/SystemBars.swift +133 -0
- package/Capacitor/Capacitor/Plugins/WebView.swift +44 -0
- package/Capacitor/Capacitor/PrivacyInfo.xcprivacy +14 -0
- package/Capacitor/Capacitor/Router.swift +29 -0
- package/Capacitor/Capacitor/TmpViewController.swift +8 -0
- package/Capacitor/Capacitor/UIColor.swift +55 -0
- package/Capacitor/Capacitor/UIStatusBarManager+CAPHandleTapAction.m +37 -0
- package/Capacitor/Capacitor/WKWebView+Capacitor.m +15 -0
- package/Capacitor/Capacitor/WKWebView+Capacitor.swift +80 -0
- package/Capacitor/Capacitor/WebViewAssetHandler.swift +550 -0
- package/Capacitor/Capacitor/WebViewDelegationHandler.swift +361 -0
- package/Capacitor/Capacitor/assets/native-bridge.js +1029 -0
- package/Capacitor.podspec +23 -0
- package/CapacitorCordova/CapacitorCordova/CapacitorCordova.h +25 -0
- package/CapacitorCordova/CapacitorCordova/CapacitorCordova.modulemap +6 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.h +8 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.m +5 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h +28 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailability.h +109 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailabilityDeprecated.h +21 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegate.h +49 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.h +39 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.m +149 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.h +31 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.m +81 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.h +52 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m +116 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin+Resources.h +39 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin+Resources.m +38 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h +76 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m +136 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.h +25 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.m +77 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.h +82 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.m +216 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVScreenOrientationDelegate.h +33 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.h +27 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.m +74 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.h +30 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m +37 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVWebViewProcessPoolFactory.h +34 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/CDVWebViewProcessPoolFactory.m +55 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.h +35 -0
- package/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.m +63 -0
- package/CapacitorCordova/CapacitorCordova/Info.plist +26 -0
- package/CapacitorCordova/CapacitorCordova/PrivacyInfo.xcprivacy +14 -0
- package/CapacitorCordova.podspec +26 -0
- package/LICENSE +21 -0
- package/package.json +33 -0
- package/scripts/pods_helpers.rb +12 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import CommonCrypto
|
|
2
|
+
import Foundation
|
|
3
|
+
|
|
4
|
+
private func hexString(_ iterator: Array<UInt8>.Iterator) -> String {
|
|
5
|
+
return iterator.map { String(format: "%02x", $0) }.joined()
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
extension Data {
|
|
9
|
+
public var sha256: String {
|
|
10
|
+
var digest = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
|
|
11
|
+
self.withUnsafeBytes { bytes in
|
|
12
|
+
_ = CC_SHA256(bytes.baseAddress, CC_LONG(self.count), &digest)
|
|
13
|
+
}
|
|
14
|
+
return hexString(digest.makeIterator())
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public class AppUUID {
|
|
19
|
+
private static let key: String = "CapacitorAppUUID"
|
|
20
|
+
|
|
21
|
+
public static func getAppUUID() -> String {
|
|
22
|
+
assertAppUUID()
|
|
23
|
+
return readUUID()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public static func regenerateAppUUID() {
|
|
27
|
+
let uuid = generateUUID()
|
|
28
|
+
writeUUID(uuid)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private static func assertAppUUID() {
|
|
32
|
+
let uuid = readUUID()
|
|
33
|
+
if uuid == "" {
|
|
34
|
+
regenerateAppUUID()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private static func generateUUID() -> String {
|
|
39
|
+
let uuid: String = UUID.init().uuidString
|
|
40
|
+
return uuid.data(using: .utf8)!.sha256
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private static func readUUID() -> String {
|
|
44
|
+
KeyValueStore.standard[key] ?? ""
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private static func writeUUID(_ uuid: String) {
|
|
48
|
+
KeyValueStore.standard[key] = uuid
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// convenience wrappers to transform Arrays between NSNull and Optional values, for interoperability with Obj-C
|
|
2
|
+
extension Array: CapacitorExtension {}
|
|
3
|
+
extension CapacitorExtensionTypeWrapper where T == [JSValue] {
|
|
4
|
+
public func replacingNullValues() -> [JSValue?] {
|
|
5
|
+
return baseType.map({ (value) -> JSValue? in
|
|
6
|
+
if value is NSNull {
|
|
7
|
+
return nil
|
|
8
|
+
}
|
|
9
|
+
return value
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public func replacingOptionalValues() -> [JSValue] {
|
|
14
|
+
return baseType
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
extension CapacitorExtensionTypeWrapper where T == [JSValue?] {
|
|
19
|
+
public func replacingNullValues() -> [JSValue?] {
|
|
20
|
+
return baseType
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public func replacingOptionalValues() -> [JSValue] {
|
|
24
|
+
return baseType.map({ (value) -> JSValue in
|
|
25
|
+
if let value = value {
|
|
26
|
+
return value
|
|
27
|
+
}
|
|
28
|
+
return NSNull()
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
@objc(CAPApplicationDelegateProxy)
|
|
4
|
+
public class ApplicationDelegateProxy: NSObject, UIApplicationDelegate {
|
|
5
|
+
public static let shared = ApplicationDelegateProxy()
|
|
6
|
+
|
|
7
|
+
public private(set) var lastURL: URL?
|
|
8
|
+
|
|
9
|
+
public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
|
10
|
+
NotificationCenter.default.post(name: .capacitorOpenURL, object: [
|
|
11
|
+
"url": url,
|
|
12
|
+
"options": options
|
|
13
|
+
])
|
|
14
|
+
NotificationCenter.default.post(name: NSNotification.Name.CDVPluginHandleOpenURL, object: url)
|
|
15
|
+
lastURL = url
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
|
|
20
|
+
// TODO: Support other types, emit to rest of plugins
|
|
21
|
+
if userActivity.activityType != NSUserActivityTypeBrowsingWeb || userActivity.webpageURL == nil {
|
|
22
|
+
return false
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let url = userActivity.webpageURL
|
|
26
|
+
lastURL = url
|
|
27
|
+
NotificationCenter.default.post(name: .capacitorOpenUniversalLink, object: [
|
|
28
|
+
"url": url
|
|
29
|
+
])
|
|
30
|
+
return true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
// the @available compiler directive does not provide an easy way to split apart string literals, so ignore the line length
|
|
4
|
+
// swiftlint:disable line_length
|
|
5
|
+
@available(*, deprecated, message: "'statusBarTappedNotification' has been moved to Notification.Name.capacitorStatusBarTapped. 'getLastUrl' and application delegate methods have been moved to ApplicationDelegateProxy.")
|
|
6
|
+
// swiftlint:enable line_length
|
|
7
|
+
@objc public class CAPBridge: NSObject {
|
|
8
|
+
@objc public static let statusBarTappedNotification = Notification(name: .capacitorStatusBarTapped)
|
|
9
|
+
|
|
10
|
+
public static func getLastUrl() -> URL? {
|
|
11
|
+
return ApplicationDelegateProxy.shared.lastURL
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public static func handleOpenUrl(_ url: URL, _ options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
|
|
15
|
+
return ApplicationDelegateProxy.shared.application(UIApplication.shared, open: url, options: options)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public static func handleContinueActivity(_ userActivity: NSUserActivity, _ restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
|
|
19
|
+
return ApplicationDelegateProxy.shared.application(UIApplication.shared, continue: userActivity, restorationHandler: restorationHandler)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public static func handleAppBecameActive(_ application: UIApplication) {
|
|
23
|
+
// no-op for now
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import WebKit
|
|
3
|
+
|
|
4
|
+
@objc public protocol CAPBridgeProtocol: NSObjectProtocol {
|
|
5
|
+
// MARK: - Environment Properties
|
|
6
|
+
var viewController: UIViewController? { get }
|
|
7
|
+
var config: InstanceConfiguration { get }
|
|
8
|
+
var webView: WKWebView? { get }
|
|
9
|
+
var notificationRouter: NotificationRouter { get }
|
|
10
|
+
var isSimEnvironment: Bool { get }
|
|
11
|
+
var isDevEnvironment: Bool { get }
|
|
12
|
+
var userInterfaceStyle: UIUserInterfaceStyle { get }
|
|
13
|
+
var autoRegisterPlugins: Bool { get }
|
|
14
|
+
var statusBarVisible: Bool { get set }
|
|
15
|
+
var statusBarStyle: UIStatusBarStyle { get set }
|
|
16
|
+
var statusBarAnimation: UIStatusBarAnimation { get set }
|
|
17
|
+
|
|
18
|
+
// MARK: - Deprecated
|
|
19
|
+
@available(*, deprecated, renamed: "webView")
|
|
20
|
+
func getWebView() -> WKWebView?
|
|
21
|
+
|
|
22
|
+
@available(*, deprecated, renamed: "isSimEnvironment")
|
|
23
|
+
func isSimulator() -> Bool
|
|
24
|
+
|
|
25
|
+
@available(*, deprecated, renamed: "isDevEnvironment")
|
|
26
|
+
func isDevMode() -> Bool
|
|
27
|
+
|
|
28
|
+
@available(*, deprecated, renamed: "statusBarVisible")
|
|
29
|
+
func getStatusBarVisible() -> Bool
|
|
30
|
+
|
|
31
|
+
@available(*, deprecated, renamed: "statusBarStyle")
|
|
32
|
+
func getStatusBarStyle() -> UIStatusBarStyle
|
|
33
|
+
|
|
34
|
+
@available(*, deprecated, renamed: "userInterfaceStyle")
|
|
35
|
+
func getUserInterfaceStyle() -> UIUserInterfaceStyle
|
|
36
|
+
|
|
37
|
+
@available(*, deprecated, message: "Moved - equivalent is found on config.localURL")
|
|
38
|
+
func getLocalUrl() -> String
|
|
39
|
+
|
|
40
|
+
@available(*, deprecated, renamed: "savedCall(withID:)")
|
|
41
|
+
func getSavedCall(_ callbackId: String) -> CAPPluginCall?
|
|
42
|
+
|
|
43
|
+
@available(*, deprecated, renamed: "releaseCall(withID:)")
|
|
44
|
+
func releaseCall(callbackId: String)
|
|
45
|
+
|
|
46
|
+
// MARK: - Plugin Access
|
|
47
|
+
func plugin(withName: String) -> CAPPlugin?
|
|
48
|
+
|
|
49
|
+
// MARK: - Call Management
|
|
50
|
+
func saveCall(_ call: CAPPluginCall)
|
|
51
|
+
func savedCall(withID: String) -> CAPPluginCall?
|
|
52
|
+
func releaseCall(_ call: CAPPluginCall)
|
|
53
|
+
func releaseCall(withID: String)
|
|
54
|
+
|
|
55
|
+
// MARK: - JavaScript Handling
|
|
56
|
+
// `js` is a short name but needs to be preserved for backwards compatibility.
|
|
57
|
+
// swiftlint:disable identifier_name
|
|
58
|
+
func evalWithPlugin(_ plugin: CAPPlugin, js: String)
|
|
59
|
+
func eval(js: String)
|
|
60
|
+
// swiftlint:enable identifier_name
|
|
61
|
+
|
|
62
|
+
@objc optional func injectScriptBeforeLoad(path: String)
|
|
63
|
+
|
|
64
|
+
func triggerJSEvent(eventName: String, target: String)
|
|
65
|
+
func triggerJSEvent(eventName: String, target: String, data: String)
|
|
66
|
+
|
|
67
|
+
func triggerWindowJSEvent(eventName: String)
|
|
68
|
+
func triggerWindowJSEvent(eventName: String, data: String)
|
|
69
|
+
|
|
70
|
+
func triggerDocumentJSEvent(eventName: String)
|
|
71
|
+
func triggerDocumentJSEvent(eventName: String, data: String)
|
|
72
|
+
|
|
73
|
+
// MARK: - Paths, Files, Assets
|
|
74
|
+
func localURL(fromWebURL webURL: URL?) -> URL?
|
|
75
|
+
func portablePath(fromLocalURL localURL: URL?) -> URL?
|
|
76
|
+
func setServerBasePath(_ path: String)
|
|
77
|
+
|
|
78
|
+
// MARK: - Plugins
|
|
79
|
+
func registerPluginType(_ pluginType: CAPPlugin.Type)
|
|
80
|
+
func registerPluginInstance(_ pluginInstance: CAPPlugin)
|
|
81
|
+
|
|
82
|
+
// MARK: - View Presentation
|
|
83
|
+
func showAlertWith(title: String, message: String, buttonTitle: String)
|
|
84
|
+
func presentVC(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)?)
|
|
85
|
+
func dismissVC(animated flag: Bool, completion: (() -> Void)?)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
Extensions to Obj-C protocols are not exposed to Obj-C code because of limitations in the runtime.
|
|
90
|
+
Therefore these methods are implicitly Swift-only.
|
|
91
|
+
|
|
92
|
+
The deprecated methods are declared here because they can be defined without colliding with the synthesized Obj-C setters
|
|
93
|
+
for the respective properties (e.g. `setStatusBarVisible:` for 'statusBarVisible`).
|
|
94
|
+
*/
|
|
95
|
+
extension CAPBridgeProtocol {
|
|
96
|
+
// variadic parameters cannot be exposed to Obj-C
|
|
97
|
+
@available(*, deprecated, message: "Use CAPLog directly")
|
|
98
|
+
public func modulePrint(_ plugin: CAPPlugin, _ items: Any...) {
|
|
99
|
+
let output = items.map { String(describing: $0) }.joined(separator: " ")
|
|
100
|
+
CAPLog.print("⚡️ ", plugin.pluginId, "-", output)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// default arguments are not permitted in protocol declarations
|
|
104
|
+
public func alert(_ title: String, _ message: String, _ buttonTitle: String = "OK") {
|
|
105
|
+
showAlertWith(title: title, message: message, buttonTitle: buttonTitle)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@available(*, deprecated, renamed: "statusBarVisible")
|
|
109
|
+
public func setStatusBarVisible(_ visible: Bool) {
|
|
110
|
+
statusBarVisible = visible
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@available(*, deprecated, renamed: "statusBarStyle")
|
|
114
|
+
public func setStatusBarStyle(_ style: UIStatusBarStyle) {
|
|
115
|
+
statusBarStyle = style
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@available(*, deprecated, renamed: "statusBarAnimation")
|
|
119
|
+
public func setStatusBarAnimation(_ animation: UIStatusBarAnimation) {
|
|
120
|
+
statusBarAnimation = animation
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/*
|
|
125
|
+
Error(s) potentially exported by the bridge.
|
|
126
|
+
*/
|
|
127
|
+
public enum CapacitorBridgeError: Error {
|
|
128
|
+
case errorExportingCoreJS
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
extension CapacitorBridgeError: CustomNSError {
|
|
132
|
+
public static var errorDomain: String { "CapacitorBridge" }
|
|
133
|
+
public var errorCode: Int {
|
|
134
|
+
switch self {
|
|
135
|
+
case .errorExportingCoreJS:
|
|
136
|
+
return 0
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
public var errorUserInfo: [String: Any] {
|
|
140
|
+
return ["info": String(describing: self)]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
extension CapacitorBridgeError: LocalizedError {
|
|
145
|
+
public var errorDescription: String? {
|
|
146
|
+
return NSLocalizedString("Unable to export JavaScript bridge code to webview", comment: "Capacitor bridge initialization error")
|
|
147
|
+
}
|
|
148
|
+
}
|