Closed
Description
webview_flutter_wkwebview
is using an API that was deprecated in iOS 14. Use an @availability
check to use the non-deprecated property, and fall back to the old one on < 14.
[[self preferencesForIdentifier:identifier] setJavaScriptEnabled:enabled.boolValue];
Deprecation says Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis
. I don't think WKWebpagePreferences
is currently created in the plugin.
FWFPreferencesHostApi.m:44:47: error: 'setJavaScriptEnabled:' is deprecated: first deprecated in iOS 14.0 - Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis [-Werror,-Wdeprecated-declarations]
[[self preferencesForIdentifier:identifier] setJavaScriptEnabled:enabled.boolValue];
^
In module 'WebKit' imported from FWFPreferencesHostApi.h:6:
WKPreferences.h:92:28: note: property 'javaScriptEnabled' is declared deprecated here
@property (nonatomic) BOOL javaScriptEnabled API_DEPRECATED("Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis", macos(10.10, 11.0), ios(8.0, 14.0));
You can see this by running:
$ dart run script/tool/bin/flutter_plugin_tools.dart xcode-analyze "--ios-min-version=14.0" --ios
args: ["xcode-analyze", "--ios", "--ios-min-version=14.0"]