Fixed iOS 14.0 crash when calling callAsyncJavaScript method

This commit is contained in:
Lorenzo Pichilli 2022-10-13 14:27:40 +02:00
parent 120d77cf8d
commit 9d54f918e1
3 changed files with 3 additions and 2 deletions

View File

@ -35,6 +35,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

@ -419,7 +419,7 @@ public class WebViewChannelDelegate : ChannelDelegate {
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

@ -2798,7 +2798,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.