@capacitor/ios 4.0.0-beta.0 → 4.0.0-nightly-2e831337.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/CAPBridgeViewController.swift +3 -3
- package/Capacitor/Capacitor/CAPLog.swift +1 -1
- package/Capacitor/Capacitor/Router.swift +2 -2
- package/Capacitor/Capacitor/WebViewAssetHandler.swift +3 -3
- package/Capacitor/Capacitor/WebViewDelegationHandler.swift +4 -4
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ public class CAPLog {
|
|
|
4
4
|
public static func print(_ items: Any..., separator: String = " ", terminator: String = "\n") {
|
|
5
5
|
if enableLogging {
|
|
6
6
|
for (itemIndex, item) in items.enumerated() {
|
|
7
|
-
Swift.print(item, terminator: itemIndex == items.count - 1 ? terminator : separator)
|
|
7
|
+
Swift.print("\(item)".prefix(4068), terminator: itemIndex == items.count - 1 ? terminator : separator)
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -18,12 +18,12 @@ internal struct _Router: Router {
|
|
|
18
18
|
var basePath: String = ""
|
|
19
19
|
func route(for path: String) -> String {
|
|
20
20
|
let pathUrl = URL(fileURLWithPath: path)
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// If there's no path extension it also means the path is empty or a SPA route
|
|
23
23
|
if pathUrl.pathExtension.isEmpty {
|
|
24
24
|
return basePath + "/index.html"
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
return basePath + path
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -4,7 +4,7 @@ import MobileCoreServices
|
|
|
4
4
|
@objc(CAPWebViewAssetHandler)
|
|
5
5
|
internal class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
|
|
6
6
|
private var router: Router
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
init(router: Router) {
|
|
9
9
|
self.router = router
|
|
10
10
|
super.init()
|
|
@@ -18,13 +18,13 @@ internal class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
|
|
|
18
18
|
let startPath: String
|
|
19
19
|
let url = urlSchemeTask.request.url!
|
|
20
20
|
let stringToLoad = url.path
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
if stringToLoad.starts(with: CapacitorBridge.fileStartIdentifier) {
|
|
23
23
|
startPath = stringToLoad.replacingOccurrences(of: CapacitorBridge.fileStartIdentifier, with: "")
|
|
24
24
|
} else {
|
|
25
25
|
startPath = router.route(for: stringToLoad)
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
let localUrl = URL.init(string: url.absoluteString)!
|
|
29
29
|
let fileUrl = URL.init(fileURLWithPath: startPath)
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ internal class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDel
|
|
|
46
46
|
// Reset the bridge on each navigation
|
|
47
47
|
bridge?.reset()
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
@available(iOS 15, *)
|
|
51
51
|
func webView(
|
|
52
52
|
_ webView: WKWebView,
|
|
@@ -60,9 +60,9 @@ internal class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDel
|
|
|
60
60
|
|
|
61
61
|
@available(iOS 15, *)
|
|
62
62
|
func webView(_ webView: WKWebView,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
requestDeviceOrientationAndMotionPermissionFor origin: WKSecurityOrigin,
|
|
64
|
+
initiatedByFrame frame: WKFrameInfo,
|
|
65
|
+
decisionHandler: @escaping (WKPermissionDecision) -> Void) {
|
|
66
66
|
decisionHandler(.grant)
|
|
67
67
|
}
|
|
68
68
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/ios",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-nightly-2e831337.0",
|
|
4
4
|
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
|
|
5
5
|
"homepage": "https://capacitorjs.com",
|
|
6
6
|
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd .."
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@capacitor/core": "^
|
|
27
|
+
"@capacitor/core": "^4.0.0-beta.0"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "2e831337bc716bbc491dad114543654b905e4b16"
|
|
33
33
|
}
|