merge
This commit is contained in:
commit
9a6934cc67
@ -11,6 +11,10 @@
|
|||||||
|
|
||||||
- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`).
|
- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`).
|
||||||
|
|
||||||
|
## 5.4.3+1
|
||||||
|
|
||||||
|
- Fixed "Latest version 5.4.3 crashes on Android" [#1159](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1159)
|
||||||
|
|
||||||
## 5.4.3
|
## 5.4.3
|
||||||
|
|
||||||
- Added Bitwise OR operator support for `AndroidActionModeMenuItem` class
|
- Added Bitwise OR operator support for `AndroidActionModeMenuItem` class
|
||||||
|
@ -36,7 +36,8 @@ public class ChromeCustomTabsActivity extends Activity implements MethodChannel.
|
|||||||
public String id;
|
public String id;
|
||||||
public CustomTabsIntent.Builder builder;
|
public CustomTabsIntent.Builder builder;
|
||||||
public ChromeCustomTabsSettings customSettings;
|
public ChromeCustomTabsSettings customSettings;
|
||||||
public CustomTabActivityHelper customTabActivityHelper;
|
public CustomTabActivityHelper customTabActivityHelper = new CustomTabActivityHelper();
|
||||||
|
@Nullable
|
||||||
public CustomTabsSession customTabsSession;
|
public CustomTabsSession customTabsSession;
|
||||||
protected final int CHROME_CUSTOM_TAB_REQUEST_CODE = 100;
|
protected final int CHROME_CUSTOM_TAB_REQUEST_CODE = 100;
|
||||||
protected boolean onChromeSafariBrowserOpened = false;
|
protected boolean onChromeSafariBrowserOpened = false;
|
||||||
@ -60,7 +61,8 @@ public class ChromeCustomTabsActivity extends Activity implements MethodChannel.
|
|||||||
id = b.getString("id");
|
id = b.getString("id");
|
||||||
|
|
||||||
String managerId = b.getString("managerId");
|
String managerId = b.getString("managerId");
|
||||||
manager = (ChromeSafariBrowserManager) ChromeSafariBrowserManager.shared.get(managerId);
|
manager = ChromeSafariBrowserManager.shared.get(managerId);
|
||||||
|
if (manager == null || manager.plugin == null|| manager.plugin.messenger == null) return;
|
||||||
|
|
||||||
channel = new MethodChannel(manager.plugin.messenger, "com.pichillilorenzo/flutter_chromesafaribrowser_" + id);
|
channel = new MethodChannel(manager.plugin.messenger, "com.pichillilorenzo/flutter_chromesafaribrowser_" + id);
|
||||||
channel.setMethodCallHandler(this);
|
channel.setMethodCallHandler(this);
|
||||||
@ -77,7 +79,6 @@ public class ChromeCustomTabsActivity extends Activity implements MethodChannel.
|
|||||||
|
|
||||||
final ChromeCustomTabsActivity chromeCustomTabsActivity = this;
|
final ChromeCustomTabsActivity chromeCustomTabsActivity = this;
|
||||||
|
|
||||||
customTabActivityHelper = new CustomTabActivityHelper();
|
|
||||||
customTabActivityHelper.setConnectionCallback(new CustomTabActivityHelper.ConnectionCallback() {
|
customTabActivityHelper.setConnectionCallback(new CustomTabActivityHelper.ConnectionCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onCustomTabsConnected() {
|
public void onCustomTabsConnected() {
|
||||||
|
@ -112,7 +112,9 @@ public class CredentialDatabaseHandler implements MethodChannel.MethodCallHandle
|
|||||||
break;
|
break;
|
||||||
case "clearAllAuthCredentials":
|
case "clearAllAuthCredentials":
|
||||||
credentialDatabase.clearAllAuthCredentials();
|
credentialDatabase.clearAllAuthCredentials();
|
||||||
|
if (plugin != null && plugin.applicationContext != null) {
|
||||||
WebViewDatabase.getInstance(plugin.applicationContext).clearHttpAuthUsernamePassword();
|
WebViewDatabase.getInstance(plugin.applicationContext).clearHttpAuthUsernamePassword();
|
||||||
|
}
|
||||||
result.success(true);
|
result.success(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -111,14 +111,18 @@ public class HeadlessInAppWebView implements MethodChannel.MethodCallHandler {
|
|||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
channel.setMethodCallHandler(null);
|
channel.setMethodCallHandler(null);
|
||||||
HeadlessInAppWebViewManager.webViews.remove(id);
|
if (HeadlessInAppWebViewManager.webViews.containsKey(id)) {
|
||||||
|
HeadlessInAppWebViewManager.webViews.put(id, null);
|
||||||
|
}
|
||||||
if (plugin != null && plugin.activity != null) {
|
if (plugin != null && plugin.activity != null) {
|
||||||
ViewGroup contentView = (ViewGroup) plugin.activity.findViewById(android.R.id.content);
|
ViewGroup contentView = (ViewGroup) plugin.activity.findViewById(android.R.id.content);
|
||||||
|
if (contentView != null) {
|
||||||
ViewGroup mainView = (ViewGroup) (contentView).getChildAt(0);
|
ViewGroup mainView = (ViewGroup) (contentView).getChildAt(0);
|
||||||
if (mainView != null && flutterWebView != null) {
|
if (mainView != null && flutterWebView != null) {
|
||||||
mainView.removeView(flutterWebView.getView());
|
mainView.removeView(flutterWebView.getView());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (flutterWebView != null) {
|
if (flutterWebView != null) {
|
||||||
flutterWebView.dispose();
|
flutterWebView.dispose();
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
package com.pichillilorenzo.flutter_inappwebview.headless_in_app_webview;
|
package com.pichillilorenzo.flutter_inappwebview.headless_in_app_webview;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin;
|
||||||
import com.pichillilorenzo.flutter_inappwebview.in_app_webview.FlutterWebView;
|
import com.pichillilorenzo.flutter_inappwebview.in_app_webview.FlutterWebView;
|
||||||
@ -50,7 +51,7 @@ public class HeadlessInAppWebViewManager implements MethodChannel.MethodCallHand
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMethodCall(final MethodCall call, final Result result) {
|
public void onMethodCall(final MethodCall call, @NonNull final Result result) {
|
||||||
final String id = (String) call.argument("id");
|
final String id = (String) call.argument("id");
|
||||||
|
|
||||||
switch (call.method) {
|
switch (call.method) {
|
||||||
@ -64,10 +65,11 @@ public class HeadlessInAppWebViewManager implements MethodChannel.MethodCallHand
|
|||||||
default:
|
default:
|
||||||
result.notImplemented();
|
result.notImplemented();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(String id, HashMap<String, Object> params) {
|
public void run(String id, HashMap<String, Object> params) {
|
||||||
|
if (plugin == null || plugin.activity == null) return;
|
||||||
|
|
||||||
FlutterWebView flutterWebView = new FlutterWebView(plugin, plugin.activity, id, params);
|
FlutterWebView flutterWebView = new FlutterWebView(plugin, plugin.activity, id, params);
|
||||||
HeadlessInAppWebView headlessInAppWebView = new HeadlessInAppWebView(plugin, id, flutterWebView);
|
HeadlessInAppWebView headlessInAppWebView = new HeadlessInAppWebView(plugin, id, flutterWebView);
|
||||||
HeadlessInAppWebViewManager.webViews.put(id, headlessInAppWebView);
|
HeadlessInAppWebViewManager.webViews.put(id, headlessInAppWebView);
|
||||||
|
@ -73,7 +73,8 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
|
|||||||
id = b.getString("id");
|
id = b.getString("id");
|
||||||
|
|
||||||
String managerId = b.getString("managerId");
|
String managerId = b.getString("managerId");
|
||||||
manager = (InAppBrowserManager) InAppBrowserManager.shared.get(managerId);
|
manager = InAppBrowserManager.shared.get(managerId);
|
||||||
|
if (manager == null || manager.plugin == null|| manager.plugin.messenger == null) return;
|
||||||
|
|
||||||
windowId = b.getInt("windowId");
|
windowId = b.getInt("windowId");
|
||||||
|
|
||||||
@ -500,7 +501,7 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
|
|||||||
methodCallDelegate = null;
|
methodCallDelegate = null;
|
||||||
}
|
}
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
if (manager.plugin.activityPluginBinding != null) {
|
if (manager != null && manager.plugin != null && manager.plugin.activityPluginBinding != null) {
|
||||||
manager.plugin.activityPluginBinding.removeActivityResultListener(webView.inAppWebViewChromeClient);
|
manager.plugin.activityPluginBinding.removeActivityResultListener(webView.inAppWebViewChromeClient);
|
||||||
}
|
}
|
||||||
ViewGroup vg = (ViewGroup) (webView.getParent());
|
ViewGroup vg = (ViewGroup) (webView.getParent());
|
||||||
|
18
example/ios/Flutter/Flutter.podspec
Normal file
18
example/ios/Flutter/Flutter.podspec
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#
|
||||||
|
# NOTE: This podspec is NOT to be published. It is only used as a local source!
|
||||||
|
# This is a generated file; do not edit or check into version control.
|
||||||
|
#
|
||||||
|
|
||||||
|
Pod::Spec.new do |s|
|
||||||
|
s.name = 'Flutter'
|
||||||
|
s.version = '1.0.0'
|
||||||
|
s.summary = 'High-performance, high-fidelity mobile apps.'
|
||||||
|
s.homepage = 'https://flutter.io'
|
||||||
|
s.license = { :type => 'MIT' }
|
||||||
|
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
|
||||||
|
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
|
||||||
|
s.ios.deployment_target = '9.0'
|
||||||
|
# Framework linking is handled by Flutter tooling, not CocoaPods.
|
||||||
|
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
|
||||||
|
s.vendored_frameworks = 'path/to/nothing'
|
||||||
|
end
|
@ -89,7 +89,7 @@ public class HeadlessInAppWebView : FlutterMethodCallDelegate {
|
|||||||
public func dispose() {
|
public func dispose() {
|
||||||
channel?.setMethodCallHandler(nil)
|
channel?.setMethodCallHandler(nil)
|
||||||
channel = nil
|
channel = nil
|
||||||
HeadlessInAppWebViewManager.webViews.removeValue(forKey: id)
|
HeadlessInAppWebViewManager.webViews[id] = nil
|
||||||
flutterWebView = nil
|
flutterWebView = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import AVFoundation
|
|||||||
public class HeadlessInAppWebViewManager: NSObject, FlutterPlugin {
|
public class HeadlessInAppWebViewManager: NSObject, FlutterPlugin {
|
||||||
static var registrar: FlutterPluginRegistrar?
|
static var registrar: FlutterPluginRegistrar?
|
||||||
static var channel: FlutterMethodChannel?
|
static var channel: FlutterMethodChannel?
|
||||||
static var webViews: [String: HeadlessInAppWebView] = [:]
|
static var webViews: [String: HeadlessInAppWebView?] = [:]
|
||||||
|
|
||||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ public class HeadlessInAppWebViewManager: NSObject, FlutterPlugin {
|
|||||||
HeadlessInAppWebViewManager.channel = nil
|
HeadlessInAppWebViewManager.channel = nil
|
||||||
HeadlessInAppWebViewManager.registrar = nil
|
HeadlessInAppWebViewManager.registrar = nil
|
||||||
let headlessWebViews = HeadlessInAppWebViewManager.webViews.values
|
let headlessWebViews = HeadlessInAppWebViewManager.webViews.values
|
||||||
headlessWebViews.forEach { (headlessWebView: HeadlessInAppWebView) in
|
headlessWebViews.forEach { (headlessWebView: HeadlessInAppWebView?) in
|
||||||
headlessWebView.dispose()
|
headlessWebView?.dispose()
|
||||||
}
|
}
|
||||||
HeadlessInAppWebViewManager.webViews.removeAll()
|
HeadlessInAppWebViewManager.webViews.removeAll()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user