Skip to content

Commit

Permalink
fix #2288
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Sep 25, 2024
1 parent 5622530 commit fffe91d
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Send a submission request to the [Submit App](https://inappwebview.dev/submit-ap
- Dart sdk: "^3.5.0"
- Flutter: ">=3.24.0"
- Android: `minSdkVersion >= 19`, `compileSdk >= 34`, [AGP](https://developer.android.com/build/releases/gradle-plugin) version `>= 7.3.0` (use [Android Studio - Android Gradle plugin Upgrade Assistant](https://developer.android.com/build/agp-upgrade-assistant) for help), support for `androidx` (see [AndroidX Migration](https://flutter.dev/docs/development/androidx-migration) to migrate an existing app)
- iOS 12.0+: `--ios-language swift`, Xcode version `>= 16.0`
- MacOS 10.14+: Xcode version `>= 16.0`
- iOS 12.0+: `--ios-language swift`, Xcode version `>= 15.0`
- MacOS 10.14+: Xcode version `>= 15.0`

## Installation

Expand Down
4 changes: 2 additions & 2 deletions flutter_inappwebview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Send a submission request to the [Submit App](https://inappwebview.dev/submit-ap
- Dart sdk: "^3.5.0"
- Flutter: ">=3.24.0"
- Android: `minSdkVersion >= 19`, `compileSdk >= 34`, [AGP](https://developer.android.com/build/releases/gradle-plugin) version `>= 7.3.0` (use [Android Studio - Android Gradle plugin Upgrade Assistant](https://developer.android.com/build/agp-upgrade-assistant) for help), support for `androidx` (see [AndroidX Migration](https://flutter.dev/docs/development/androidx-migration) to migrate an existing app)
- iOS 12.0+: `--ios-language swift`, Xcode version `>= 16.0`
- MacOS 10.14+: Xcode version `>= 16.0`
- iOS 12.0+: `--ios-language swift`, Xcode version `>= 15.0`
- MacOS 10.14+: Xcode version `>= 15.0`

## Installation

Expand Down
4 changes: 4 additions & 0 deletions flutter_inappwebview_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.0+1

- Fixed "v6.1.0 fails to compile on Xcode 15" [#2288](https://github.com/pichillilorenzo/flutter_inappwebview/issues/2288)

## 1.1.0

- Fixed XCode 16 build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
}
}

#if compiler(>=6.0)
public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {
if let applePayAPIEnabled = settings?.applePayAPIEnabled, applePayAPIEnabled {
if let completionHandler = completionHandler {
Expand All @@ -1438,6 +1439,17 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
}
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
}
#else
public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {
if let applePayAPIEnabled = settings?.applePayAPIEnabled, applePayAPIEnabled {
if let completionHandler = completionHandler {
completionHandler(nil, nil)
}
return
}
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
}
#endif

@available(iOS 14.0, *)
public func evaluateJavaScript(_ javaScript: String, frame: WKFrameInfo? = nil, contentWorld: WKContentWorld, completionHandler: ((Result<Any, Error>) -> Void)? = nil) {
Expand Down
2 changes: 1 addition & 1 deletion flutter_inappwebview_ios/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inappwebview_ios
description: iOS implementation of the flutter_inappwebview plugin.
version: 1.1.0
version: 1.1.0+1
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_ios
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
Expand Down
4 changes: 4 additions & 0 deletions flutter_inappwebview_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.0+1

- Fixed "v6.1.0 fails to compile on Xcode 15" [#2288](https://github.com/pichillilorenzo/flutter_inappwebview/issues/2288)

## 1.1.0

- Added `InAppWebView` support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ public class InAppWebView: WKWebView, WKUIDelegate,
}
}

#if compiler(>=6.0)
public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) {
if let applePayAPIEnabled = settings?.applePayAPIEnabled, applePayAPIEnabled {
if let completionHandler = completionHandler {
Expand All @@ -876,6 +877,17 @@ public class InAppWebView: WKWebView, WKUIDelegate,
}
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
}
#else
public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: ((Any?, Error?) -> Void)? = nil) {
if let applePayAPIEnabled = settings?.applePayAPIEnabled, applePayAPIEnabled {
if let completionHandler = completionHandler {
completionHandler(nil, nil)
}
return
}
super.evaluateJavaScript(javaScriptString, completionHandler: completionHandler)
}
#endif

@available(macOS 11.0, *)
public func evaluateJavaScript(_ javaScript: String, frame: WKFrameInfo? = nil, contentWorld: WKContentWorld, completionHandler: ((Result<Any, Error>) -> Void)? = nil) {
Expand Down
2 changes: 1 addition & 1 deletion flutter_inappwebview_macos/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inappwebview_macos
description: macOS implementation of the flutter_inappwebview plugin.
version: 1.1.0
version: 1.1.0+1
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_macos
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
Expand Down

0 comments on commit fffe91d

Please sign in to comment.