Skip to content

Commit 82c9ad5

Browse files
authored
[webview_flutter_wkwebview] Roll back iOS and macOS versions (flutter#13354)
Revert part of flutter#13294 that updated the iOS and macOS versions. Re-add the availability checks. Still fix the `SecTrustGetCertificateAtIndex` deprecation issue. Due to Swift Package Manager issue flutter#194864, this broke plugins with dependencies targeting lower versions. Unblocks flutter#194871 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 5b1f975 commit 82c9ad5

19 files changed

Lines changed: 143 additions & 39 deletions

‎packages/webview_flutter/webview_flutter/CHANGELOG.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
## NEXT
22

33
* Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
4-
* Updates README to reflect that the latest version of `webview_flutter_wkwebview`
5-
requires iOS 15 and macOS 12.
6-
* Applications built with older versions of Flutter will continue to use
7-
compatible versions of the platform implementation.
84

95
## 4.14.1
106

‎packages/webview_flutter/webview_flutter/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ On Android the WebView widget is backed by a [WebView](https://developer.android
1111

1212
| | Android | iOS | macOS |
1313
|-------------|---------|-------|--------|
14-
| **Support** | SDK 24+ | 15.0+ | 12.0+ |
14+
| **Support** | SDK 24+ | 13.0+ | 10.15+ |
1515

1616
## Usage
1717

‎packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.27.2
2+
3+
* Restores the minimum iOS version to 13 and minimum macOS version to 10.15.
4+
* Suppresses `SecTrustGetCertificateAtIndex` deprecation warnings.
5+
16
## 3.27.1
27

38
* Updates minimum iOS version to 15 and minimum macOS version to 12.

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/PreferencesProxyAPITests.swift‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ import WebKit
99
@testable import webview_flutter_wkwebview
1010

1111
@Suite struct PreferencesProxyAPITests {
12-
@MainActor @Test func setJavaScriptEnabledThrowsUnsupported() throws {
13-
let registrar = TestProxyApiRegistrar()
14-
let api = registrar.apiDelegate.pigeonApiWKPreferences(registrar)
12+
@MainActor @Test func setJavaScriptEnabled() throws {
13+
if #available(iOS 14.0, macOS 11.0, *) {
14+
return
1515

16-
let instance = WKPreferences()
17-
#expect(throws: (any Error).self) {
16+
} else {
17+
let registrar = TestProxyApiRegistrar()
18+
let api = registrar.apiDelegate.pigeonApiWKPreferences(registrar)
19+
20+
let instance = WKPreferences()
21+
let enabled = true
1822
try api.pigeonDelegate.setJavaScriptEnabled(
19-
pigeonApi: api, pigeonInstance: instance, enabled: true)
23+
pigeonApi: api, pigeonInstance: instance, enabled: enabled)
24+
25+
#expect(instance.javaScriptEnabled == enabled)
2026
}
2127
}
2228

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/SecTrustProxyAPITests.swift‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ class TestSecTrustProxyAPIDelegate: SecTrustProxyAPIDelegate {
121121
}
122122

123123
override func secTrustCopyCertificateChain(_ trust: SecTrust) -> CFArray? {
124-
return [createDummyCertificate()] as CFArray
124+
if #available(iOS 15.0, macOS 12.0, *) {
125+
return [createDummyCertificate()] as CFArray
126+
}
127+
128+
return nil
125129
}
126130
}

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/UIDelegateProxyAPITests.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import WebKit
3333
#expect(result == nil)
3434
}
3535

36+
@available(iOS 15.0, macOS 12.0, *)
3637
@MainActor @Test func requestMediaCapturePermission() async throws {
3738
let api = TestDelegateApi()
3839
let registrar = TestProxyApiRegistrar()

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebViewConfigurationProxyAPITests.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ import WebKit
100100
#endif
101101
}
102102

103+
@available(iOS 14.0, macOS 11.0, *)
103104
@MainActor @Test func setLimitsNavigationsToAppBoundDomains() throws {
104105
let registrar = TestProxyApiRegistrar()
105106
let api = registrar.apiDelegate.pigeonApiWKWebViewConfiguration(registrar)

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/WebpagePreferencesProxyAPITests.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import WebKit
99
@testable import webview_flutter_wkwebview
1010

1111
@Suite struct WebpagePreferencesProxyAPITests {
12+
@available(iOS 14.0, macOS 11.0, *)
1213
@MainActor @Test func setAllowsContentJavaScript() throws {
1314
let registrar = TestProxyApiRegistrar()
1415
let api = registrar.apiDelegate.pigeonApiWKWebpagePreferences(registrar)

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Downloaded by pub (not CocoaPods).
1717
s.source_files = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/**/*.swift'
1818
s.ios.dependency 'Flutter'
1919
s.osx.dependency 'FlutterMacOS'
20-
s.ios.deployment_target = '15.0'
21-
s.osx.deployment_target = '12.0'
20+
s.ios.deployment_target = '13.0'
21+
s.osx.deployment_target = '10.15'
2222
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
2323
s.resource_bundles = {'webview_flutter_wkwebview_privacy' => ['webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy']}
2424
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }

‎packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import PackageDescription
99
let package = Package(
1010
name: "webview_flutter_wkwebview",
1111
platforms: [
12-
.iOS("15.0"),
13-
.macOS("12.0"),
12+
.iOS("13.0"),
13+
.macOS("10.15"),
1414
],
1515
products: [
1616
.library(name: "webview-flutter-wkwebview", targets: ["webview_flutter_wkwebview"])

0 commit comments

Comments
 (0)