@capacitor/ios 4.7.3 → 4.8.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 +16 -0
- package/Capacitor/Capacitor/CAPInstanceConfiguration.h +1 -0
- package/Capacitor/Capacitor/CAPInstanceConfiguration.m +2 -0
- package/Capacitor/Capacitor/CAPInstanceDescriptor.h +5 -0
- package/Capacitor/Capacitor/CAPInstanceDescriptor.m +1 -0
- package/Capacitor/Capacitor/CAPInstanceDescriptor.swift +7 -0
- package/Capacitor/Capacitor/Capacitor.h +2 -0
- package/Capacitor/Capacitor/CapacitorBridge.swift +11 -0
- package/Capacitor/Capacitor/WKWebView+Capacitor.h +11 -0
- package/Capacitor/Capacitor/WKWebView+Capacitor.m +13 -0
- package/Capacitor/Capacitor/assets/native-bridge.js +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
# [4.8.0](https://github.com/ionic-team/capacitor/compare/4.7.3...4.8.0) (2023-04-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **http:** copy native response url to fetch response ([42d2eb3](https://github.com/ionic-team/capacitor/commit/42d2eb3c3c04e087b88df7252cd2c323b00a3f95))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **ios:** add webContentsDebuggingEnabled configuration ([#6500](https://github.com/ionic-team/capacitor/issues/6500)) ([b9e345a](https://github.com/ionic-team/capacitor/commit/b9e345a8f02229650eabc829d49c9d9e7227eb57))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [4.7.3](https://github.com/ionic-team/capacitor/compare/4.7.2...4.7.3) (2023-03-31)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @capacitor/ios
|
|
@@ -19,6 +19,7 @@ NS_SWIFT_NAME(InstanceConfiguration)
|
|
|
19
19
|
@property (nonatomic, readonly) BOOL scrollingEnabled;
|
|
20
20
|
@property (nonatomic, readonly) BOOL allowLinkPreviews;
|
|
21
21
|
@property (nonatomic, readonly) BOOL handleApplicationNotifications;
|
|
22
|
+
@property (nonatomic, readonly) BOOL isWebDebuggable;
|
|
22
23
|
@property (nonatomic, readonly) BOOL cordovaDeployDisabled;
|
|
23
24
|
@property (nonatomic, readonly) UIScrollViewContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior;
|
|
24
25
|
@property (nonatomic, readonly, nonnull) NSURL *appLocation;
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
_limitsNavigationsToAppBoundDomains = descriptor.limitsNavigationsToAppBoundDomains;
|
|
38
38
|
_preferredContentMode = descriptor.preferredContentMode;
|
|
39
39
|
_pluginConfigurations = descriptor.pluginConfigurations;
|
|
40
|
+
_isWebDebuggable = descriptor.isWebDebuggable;
|
|
40
41
|
_legacyConfig = descriptor.legacyConfig;
|
|
41
42
|
// construct the necessary URLs
|
|
42
43
|
_localURL = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"%@://%@", descriptor.urlScheme, descriptor.urlHostname]];
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
_scrollingEnabled = configuration.scrollingEnabled;
|
|
68
69
|
_allowLinkPreviews = configuration.allowLinkPreviews;
|
|
69
70
|
_handleApplicationNotifications = configuration.handleApplicationNotifications;
|
|
71
|
+
_isWebDebuggable = configuration.isWebDebuggable;
|
|
70
72
|
_cordovaDeployDisabled = configuration.cordovaDeployDisabled;
|
|
71
73
|
_contentInsetAdjustmentBehavior = configuration.contentInsetAdjustmentBehavior;
|
|
72
74
|
// we don't care about internal usage of deprecated APIs and the framework should build cleanly
|
|
@@ -93,6 +93,11 @@ NS_SWIFT_NAME(InstanceDescriptor)
|
|
|
93
93
|
@discussion Defaults to @c true. Required to be @c true for notification plugins to work correctly. Set to @c false if your application will handle notifications independently.
|
|
94
94
|
*/
|
|
95
95
|
@property (nonatomic, assign) BOOL handleApplicationNotifications;
|
|
96
|
+
/**
|
|
97
|
+
@brief Enables web debugging by setting isInspectable of @c WKWebView to @c true on iOS 16.4 and greater
|
|
98
|
+
@discussion Defaults to true in debug mode and false in production
|
|
99
|
+
*/
|
|
100
|
+
@property (nonatomic, assign) BOOL isWebDebuggable;
|
|
96
101
|
/**
|
|
97
102
|
@brief How the web view will inset its content
|
|
98
103
|
@discussion Set by @c ios.contentInset in the configuration file. Corresponds to @c contentInsetAdjustmentBehavior on WKWebView.
|
|
@@ -39,6 +39,7 @@ NSString* const CAPInstanceDescriptorDefaultHostname = @"localhost";
|
|
|
39
39
|
_scrollingEnabled = YES;
|
|
40
40
|
_allowLinkPreviews = YES;
|
|
41
41
|
_handleApplicationNotifications = YES;
|
|
42
|
+
_isWebDebuggable = NO;
|
|
42
43
|
_contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
43
44
|
_appLocation = location;
|
|
44
45
|
_limitsNavigationsToAppBoundDomains = FALSE;
|
|
@@ -134,6 +134,13 @@ internal extension InstanceDescriptor {
|
|
|
134
134
|
if let handleNotifications = config[keyPath: "ios.handleApplicationNotifications"] as? Bool {
|
|
135
135
|
handleApplicationNotifications = handleNotifications
|
|
136
136
|
}
|
|
137
|
+
if let webContentsDebuggingEnabled = config[keyPath: "ios.webContentsDebuggingEnabled"] as? Bool {
|
|
138
|
+
isWebDebuggable = webContentsDebuggingEnabled
|
|
139
|
+
} else {
|
|
140
|
+
#if DEBUG
|
|
141
|
+
isWebDebuggable = true
|
|
142
|
+
#endif
|
|
143
|
+
}
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
146
|
// swiftlint:enable cyclomatic_complexity
|
|
@@ -209,6 +209,8 @@ internal class CapacitorBridge: NSObject, CAPBridgeProtocol {
|
|
|
209
209
|
observers.append(NotificationCenter.default.addObserver(forName: type(of: self).tmpVCAppeared.name, object: .none, queue: .none) { [weak self] _ in
|
|
210
210
|
self?.tmpWindow = nil
|
|
211
211
|
})
|
|
212
|
+
|
|
213
|
+
self.setupWebDebugging(configuration: configuration)
|
|
212
214
|
}
|
|
213
215
|
|
|
214
216
|
deinit {
|
|
@@ -436,6 +438,15 @@ internal class CapacitorBridge: NSObject, CAPBridgeProtocol {
|
|
|
436
438
|
return "\(type(of: self).capacitorSite)docs/\(url)"
|
|
437
439
|
}
|
|
438
440
|
|
|
441
|
+
private func setupWebDebugging(configuration: InstanceConfiguration) {
|
|
442
|
+
let isWebDebuggable = configuration.isWebDebuggable
|
|
443
|
+
if isWebDebuggable, #unavailable(iOS 16.4) {
|
|
444
|
+
CAPLog.print("⚡️ Warning: isWebDebuggable only functions as intended on iOS 16.4 and above.")
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
self.webView?.setInspectableIfRequired(isWebDebuggable)
|
|
448
|
+
}
|
|
449
|
+
|
|
439
450
|
/**
|
|
440
451
|
Handle a call from JavaScript. First, find the corresponding plugin, construct a selector,
|
|
441
452
|
and perform that selector on the plugin instance.
|
|
@@ -13,3 +13,16 @@
|
|
|
13
13
|
[self _swizzleKeyboardMethods];
|
|
14
14
|
}
|
|
15
15
|
@end
|
|
16
|
+
|
|
17
|
+
// TODO: Remove this after Xcode 14.3 is required
|
|
18
|
+
@implementation WKWebView (CapacitorInspectablity)
|
|
19
|
+
|
|
20
|
+
- (void)setInspectableIfRequired: (BOOL)shouldInspect {
|
|
21
|
+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
|
|
22
|
+
if (@available(iOS 16.4, *)) {
|
|
23
|
+
self.inspectable = shouldInspect;
|
|
24
|
+
}
|
|
25
|
+
#endif
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@end
|
|
@@ -392,6 +392,14 @@ var nativeBridge = (function (exports) {
|
|
|
392
392
|
headers: nativeResponse.headers,
|
|
393
393
|
status: nativeResponse.status,
|
|
394
394
|
});
|
|
395
|
+
/*
|
|
396
|
+
* copy url to response, `cordova-plugin-ionic` uses this url from the response
|
|
397
|
+
* we need `Object.defineProperty` because url is an inherited getter on the Response
|
|
398
|
+
* see: https://stackoverflow.com/a/57382543
|
|
399
|
+
* */
|
|
400
|
+
Object.defineProperty(response, 'url', {
|
|
401
|
+
value: nativeResponse.url,
|
|
402
|
+
});
|
|
395
403
|
console.timeEnd(tag);
|
|
396
404
|
return response;
|
|
397
405
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/ios",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.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": "
|
|
33
|
+
"gitHead": "b43c69d9d6530fa1a0cc461d6db14859865ed995"
|
|
34
34
|
}
|