@capacitor/ios 4.0.1 → 4.0.2-nightly-478d48c3.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.
@@ -70,6 +70,7 @@ import WebKit
70
70
  // MARK: - Paths, Files, Assets
71
71
  func localURL(fromWebURL webURL: URL?) -> URL?
72
72
  func portablePath(fromLocalURL localURL: URL?) -> URL?
73
+ func setServerBasePath(_ path: String)
73
74
 
74
75
  // MARK: - View Presentation
75
76
  func showAlertWith(title: String, message: String, buttonTitle: String)
@@ -263,16 +263,10 @@ extension CAPBridgeViewController {
263
263
  }
264
264
 
265
265
  @objc public func setServerBasePath(path: String) {
266
- let url = URL(fileURLWithPath: path, isDirectory: true)
267
- guard let capBridge = capacitorBridge, FileManager.default.fileExists(atPath: url.path) else {
268
- return
269
- }
270
- capBridge.config = capBridge.config.updatingAppLocation(url)
271
- capBridge.webViewAssetHandler.setAssetPath(url.path)
272
- if let url = capacitorBridge?.config.serverURL {
273
- DispatchQueue.main.async { [weak self] in
274
- _ = self?.webView?.load(URLRequest(url: url))
275
- }
266
+ guard let capBridge = capacitorBridge else { return }
267
+ capBridge.setServerBasePath(path)
268
+ DispatchQueue.main.async { [weak self] in
269
+ _ = self?.webView?.load(URLRequest(url: capBridge.config.serverURL))
276
270
  }
277
271
  }
278
272
  }
@@ -123,7 +123,7 @@ open class CAPWebView: UIView {
123
123
 
124
124
  extension CAPWebView {
125
125
 
126
- open func webViewConfiguration(for instanceConfiguration: InstanceConfiguration) -> WKWebViewConfiguration {
126
+ public func webViewConfiguration(for instanceConfiguration: InstanceConfiguration) -> WKWebViewConfiguration {
127
127
  let webViewConfiguration = WKWebViewConfiguration()
128
128
  webViewConfiguration.allowsInlineMediaPlayback = true
129
129
  webViewConfiguration.suppressesIncrementalRendering = false
@@ -156,6 +156,13 @@ internal class CapacitorBridge: NSObject, CAPBridgeProtocol {
156
156
  statusBarAnimation = animation
157
157
  }
158
158
 
159
+ public func setServerBasePath(_ path: String) {
160
+ let url = URL(fileURLWithPath: path, isDirectory: true)
161
+ guard FileManager.default.fileExists(atPath: url.path) else { return }
162
+ config = config.updatingAppLocation(url)
163
+ webViewAssetHandler.setAssetPath(url.path)
164
+ }
165
+
159
166
  // MARK: - Static Methods
160
167
 
161
168
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "4.0.1",
3
+ "version": "4.0.2-nightly-478d48c3.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)",
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "a14824b660ccd39b7ed150a26debb15e9a161303"
33
+ "gitHead": "478d48c3e322cffc6f0ff7ce590b635de4b41279"
34
34
  }