@capacitor/ios 3.7.0 → 3.9.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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.9.0](https://github.com/ionic-team/capacitor/compare/3.8.0...3.9.0) (2022-10-21)
7
+
8
+ **Note:** Version bump only for package @capacitor/ios
9
+
10
+
11
+
12
+
13
+
14
+ # [3.8.0](https://github.com/ionic-team/capacitor/compare/3.7.0...3.8.0) (2022-09-08)
15
+
16
+
17
+ ### Features
18
+
19
+ * **ios:** Add `setServerBasePath(_:)` to CAPBridgeProtocol ([#5860](https://github.com/ionic-team/capacitor/issues/5860)) ([#5892](https://github.com/ionic-team/capacitor/issues/5892)) ([9954281](https://github.com/ionic-team/capacitor/commit/995428129de9c06e199b67264b9840bb4a87939e))
20
+
21
+
22
+
23
+
24
+
6
25
  # [3.7.0](https://github.com/ionic-team/capacitor/compare/3.6.0...3.7.0) (2022-08-01)
7
26
 
8
27
 
@@ -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)
@@ -258,16 +258,10 @@ extension CAPBridgeViewController {
258
258
  }
259
259
 
260
260
  @objc public func setServerBasePath(path: String) {
261
- let url = URL(fileURLWithPath: path, isDirectory: true)
262
- guard let capBridge = capacitorBridge, FileManager.default.fileExists(atPath: url.path) else {
263
- return
264
- }
265
- capBridge.config = capBridge.config.updatingAppLocation(url)
266
- capBridge.webViewAssetHandler.setAssetPath(url.path)
267
- if let url = capacitorBridge?.config.serverURL {
268
- DispatchQueue.main.async { [weak self] in
269
- _ = self?.webView?.load(URLRequest(url: url))
270
- }
261
+ guard let capBridge = capacitorBridge else { return }
262
+ capBridge.setServerBasePath(path)
263
+ DispatchQueue.main.async { [weak self] in
264
+ _ = self?.webView?.load(URLRequest(url: capBridge.config.serverURL))
271
265
  }
272
266
  }
273
267
  }
@@ -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": "3.7.0",
3
+ "version": "3.9.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": "^3.7.0"
27
+ "@capacitor/core": "^3.9.0"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "84ec6619623510e345b2637e33febe94b10cc736"
32
+ "gitHead": "70a7e72b7461acd5b9bdc89fc9e0232ae8597005"
33
33
  }