Fixed iOS 14.0 crash when calling callAsyncJavaScript method

This commit is contained in:
Lorenzo Pichilli 2022-10-13 14:21:26 +02:00
parent 6abf958b31
commit e46523aef3
3 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@
- Fixed Android `PullToRefreshController.setEnabled` at runtime
- Fixed iOS `findNext`
- Fixed Android `RendererPriorityPolicy.waivedWhenNotVisible` type 'Null' is not a subtype of type 'bool'
- Fixed iOS 14.0 crash when calling `callAsyncJavaScript` method
## 5.4.4+3

View File

@ -417,7 +417,7 @@ public class InAppWebViewMethodHandler: FlutterMethodCallDelegate {
break
case "callAsyncJavaScript":
if let webView = webView, #available(iOS 10.3, *) {
if #available(iOS 14.0, *) {
if #available(iOS 14.3, *) { // on iOS 14.0, for some reason, it crashes
let functionBody = arguments!["functionBody"] as! String
let functionArguments = arguments!["arguments"] as! [String:Any]
var contentWorld = WKContentWorld.page

View File

@ -2218,7 +2218,7 @@ class InAppWebViewController {
///This parameter doesnt apply to changes you make to the underlying web content, such as the documents DOM structure.
///Those changes remain visible to all scripts, regardless of which content world you specify.
///For more information about content worlds, see [ContentWorld].
///Available on iOS 14.0+.
///Available on iOS 14.3+.
///
///**NOTE**: This method shouldn't be called in the [WebView.onWebViewCreated] or [WebView.onLoadStart] events,
///because, in these events, the [WebView] is not ready to handle it yet.