fix #1881, fixed PlatformPrintJobController.onComplete setter

This commit is contained in:
Lorenzo Pichilli 2023-11-28 01:27:06 +01:00
parent fcb92e2bbc
commit f7967d0a42
22 changed files with 82 additions and 35 deletions

View File

@ -1,3 +1,8 @@
## 6.0.0-beta.30
- Updated minimum platform interface and implementation versions
- Fixed "Crash when starting ChromeSafariBrowser on Android java.lang.NoSuchMethodError: No virtual method isEngagementSignalsApiAvailable" [#1881](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1881)
## 6.0.0-beta.29
### BREAKING CHANGES

View File

@ -6,8 +6,9 @@ import 'main.dart';
class MyChromeSafariBrowser extends ChromeSafariBrowser {
@override
void onOpened() {
void onOpened() async {
print("ChromeSafari browser opened");
print(await isEngagementSignalsApiAvailable());
}
@override

View File

@ -31,6 +31,18 @@ dependencies:
flutter_inappwebview:
path: ../
dependency_overrides:
flutter_inappwebview_platform_interface:
path: ../flutter_inappwebview_platform_interface
flutter_inappwebview_android:
path: ../flutter_inappwebview_android
flutter_inappwebview_ios:
path: ../flutter_inappwebview_ios
flutter_inappwebview_macos:
path: ../flutter_inappwebview_macos
flutter_inappwebview_web:
path: ../flutter_inappwebview_web
dev_dependencies:
flutter_test:
sdk: flutter

View File

@ -1,3 +1,8 @@
## 1.0.2
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2`
- Fixed "Crash when starting ChromeSafariBrowser on Android java.lang.NoSuchMethodError: No virtual method isEngagementSignalsApiAvailable" [#1881](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1881)
## 1.0.1
- Updated README

View File

@ -9,6 +9,7 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.widget.RemoteViews;
import androidx.annotation.CallSuper;
@ -239,7 +240,8 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
}
}, bundle);
}
} catch (Exception ignored) {
} catch (Throwable e) {
Log.d(LOG_TAG, "Custom Tabs Engagement Signals API not supported", e);
}
}

View File

@ -106,7 +106,7 @@ public class ChromeCustomTabsChannelDelegate extends ChannelDelegateImpl {
if (chromeCustomTabsActivity != null && chromeCustomTabsActivity.customTabsSession != null) {
try {
result.success(chromeCustomTabsActivity.customTabsSession.isEngagementSignalsApiAvailable(new Bundle()));
} catch (Exception e) {
} catch (Throwable e) {
result.success(false);
}
} else {

View File

@ -81,7 +81,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.1"
flutter_inappwebview_internal_annotations:
dependency: transitive
description:
@ -93,11 +93,10 @@ packages:
flutter_inappwebview_platform_interface:
dependency: transitive
description:
name: flutter_inappwebview_platform_interface
sha256: c221a6788c73421284208e3449cad07d8c65fdace120322483181a2b94d95697
url: "https://pub.dev"
source: hosted
version: "1.0.0"
path: "../../flutter_inappwebview_platform_interface"
relative: true
source: path
version: "1.0.2"
flutter_lints:
dependency: "direct dev"
description:

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_android
description: Android implementation of the flutter_inappwebview plugin.
version: 1.0.1
version: 1.0.2
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_android
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
@ -18,7 +18,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_inappwebview_platform_interface: ^1.0.0
flutter_inappwebview_platform_interface: ^1.0.2
dev_dependencies:
flutter_test:

View File

@ -1,3 +1,8 @@
## 1.0.2
- Added `PlatformPrintJobController.onComplete` setter
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2`
## 1.0.1
- Updated README

View File

@ -89,15 +89,14 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.2"
flutter_inappwebview_platform_interface:
dependency: transitive
description:
name: flutter_inappwebview_platform_interface
sha256: c221a6788c73421284208e3449cad07d8c65fdace120322483181a2b94d95697
url: "https://pub.dev"
source: hosted
version: "1.0.0"
path: "../../flutter_inappwebview_platform_interface"
relative: true
source: path
version: "1.0.2"
flutter_lints:
dependency: "direct dev"
description:

View File

@ -35,6 +35,7 @@ class IOSPrintJobController extends PlatformPrintJobController
: IOSPrintJobControllerCreationParams
.fromPlatformPrintJobControllerCreationParams(params),
) {
onComplete = params.onComplete;
channel = MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_printjobcontroller_${params.id}');
handler = _handleMethod;
@ -46,8 +47,8 @@ class IOSPrintJobController extends PlatformPrintJobController
case "onComplete":
bool completed = call.arguments["completed"];
String? error = call.arguments["error"];
if (params.onComplete != null) {
params.onComplete!(completed, error);
if (onComplete != null) {
onComplete!(completed, error);
}
break;
default:

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_ios
description: iOS implementation of the flutter_inappwebview plugin.
version: 1.0.1
version: 1.0.2
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
@ -18,7 +18,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_inappwebview_platform_interface: ^1.0.0
flutter_inappwebview_platform_interface: ^1.0.2
dev_dependencies:
flutter_test:

View File

@ -1,3 +1,8 @@
## 1.0.1
- Added `PlatformPrintJobController.onComplete` setter
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2`
## 1.0.0
Initial release.

View File

@ -35,6 +35,7 @@ class MacOSPrintJobController extends PlatformPrintJobController
: MacOSPrintJobControllerCreationParams
.fromPlatformPrintJobControllerCreationParams(params),
) {
onComplete = params.onComplete;
channel = MethodChannel(
'com.pichillilorenzo/flutter_inappwebview_printjobcontroller_${params.id}');
handler = _handleMethod;
@ -46,8 +47,8 @@ class MacOSPrintJobController extends PlatformPrintJobController
case "onComplete":
bool completed = call.arguments["completed"];
String? error = call.arguments["error"];
if (params.onComplete != null) {
params.onComplete!(completed, error);
if (onComplete != null) {
onComplete!(completed, error);
}
break;
default:

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_macos
description: macOS implementation of the flutter_inappwebview plugin.
version: 1.0.0
version: 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
@ -18,7 +18,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_inappwebview_platform_interface: ^1.0.0
flutter_inappwebview_platform_interface: ^1.0.2
dev_dependencies:
flutter_test:

View File

@ -1,3 +1,7 @@
## 1.0.2
- Added `PlatformPrintJobController.onComplete` setter
## 1.0.1
- Updated README

View File

@ -76,7 +76,7 @@ abstract class PlatformPrintJobController extends PlatformInterface
///- iOS ([Official API - UIPrintInteractionController.CompletionHandler](https://developer.apple.com/documentation/uikit/uiprintinteractioncontroller/completionhandler))
///- MacOS ([Official API - NSPrintOperation.runModal](https://developer.apple.com/documentation/appkit/nsprintoperation/1532065-runmodal))
///{@endtemplate}
PrintJobCompletionHandler? get onComplete => params.onComplete;
PrintJobCompletionHandler? onComplete;
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.cancel}
///Cancels this print job.

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_platform_interface
description: A common platform interface for the flutter_inappwebview plugin.
version: 1.0.1
version: 1.0.2
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_platform_interface
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues

View File

@ -1,3 +1,7 @@
## 1.0.1
- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2`
## 1.0.0
Initial release.

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_web
description: Web implementation of the flutter_inappwebview plugin.
version: 1.0.0
version: 1.0.1
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_web
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
@ -21,7 +21,7 @@ dependencies:
flutter_web_plugins:
sdk: flutter
js: ^0.6.4
flutter_inappwebview_platform_interface: ^1.0.0
flutter_inappwebview_platform_interface: ^1.0.2
dev_dependencies:
flutter_test:

View File

@ -28,6 +28,10 @@ class PrintJobController {
///{@macro flutter_inappwebview_platform_interface.PlatformPrintJobController.onComplete}
PrintJobCompletionHandler? get onComplete => platform.onComplete;
void set onComplete(PrintJobCompletionHandler? handler) {
platform.onComplete = handler;
}
///{@macro flutter_inappwebview_platform_interface.PlatformPrintJobController.cancel}
Future<void> cancel() => platform.cancel();

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
version: 6.0.0-beta.29
version: 6.0.0-beta.30
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
@ -18,11 +18,11 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_inappwebview_platform_interface: ^1.0.0
flutter_inappwebview_android: ^1.0.0
flutter_inappwebview_ios: ^1.0.0
flutter_inappwebview_macos: ^1.0.0
flutter_inappwebview_web: ^1.0.0
flutter_inappwebview_platform_interface: ^1.0.2
flutter_inappwebview_android: ^1.0.2
flutter_inappwebview_ios: ^1.0.2
flutter_inappwebview_macos: ^1.0.1
flutter_inappwebview_web: ^1.0.1
dev_dependencies:
flutter_test: