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 ## 6.0.0-beta.29
### BREAKING CHANGES ### BREAKING CHANGES

View File

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

View File

@ -31,6 +31,18 @@ dependencies:
flutter_inappwebview: flutter_inappwebview:
path: ../ 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: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter 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 ## 1.0.1
- Updated README - Updated README

View File

@ -9,6 +9,7 @@ import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
@ -239,7 +240,8 @@ public class ChromeCustomTabsActivity extends Activity implements Disposable {
} }
}, bundle); }, 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) { if (chromeCustomTabsActivity != null && chromeCustomTabsActivity.customTabsSession != null) {
try { try {
result.success(chromeCustomTabsActivity.customTabsSession.isEngagementSignalsApiAvailable(new Bundle())); result.success(chromeCustomTabsActivity.customTabsSession.isEngagementSignalsApiAvailable(new Bundle()));
} catch (Exception e) { } catch (Throwable e) {
result.success(false); result.success(false);
} }
} else { } else {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_ios name: flutter_inappwebview_ios
description: iOS implementation of the flutter_inappwebview plugin. description: iOS implementation of the flutter_inappwebview plugin.
version: 1.0.1 version: 1.0.2
homepage: https://inappwebview.dev/ homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_ios repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_ios
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
@ -18,7 +18,7 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_inappwebview_platform_interface: ^1.0.0 flutter_inappwebview_platform_interface: ^1.0.2
dev_dependencies: dev_dependencies:
flutter_test: 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 ## 1.0.0
Initial release. Initial release.

View File

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

View File

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

View File

@ -1,3 +1,7 @@
## 1.0.2
- Added `PlatformPrintJobController.onComplete` setter
## 1.0.1 ## 1.0.1
- Updated README - 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)) ///- 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)) ///- MacOS ([Official API - NSPrintOperation.runModal](https://developer.apple.com/documentation/appkit/nsprintoperation/1532065-runmodal))
///{@endtemplate} ///{@endtemplate}
PrintJobCompletionHandler? get onComplete => params.onComplete; PrintJobCompletionHandler? onComplete;
///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.cancel} ///{@template flutter_inappwebview_platform_interface.PlatformPrintJobController.cancel}
///Cancels this print job. ///Cancels this print job.

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview_platform_interface name: flutter_inappwebview_platform_interface
description: A common platform interface for the flutter_inappwebview plugin. description: A common platform interface for the flutter_inappwebview plugin.
version: 1.0.1 version: 1.0.2
homepage: https://inappwebview.dev/ homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_platform_interface repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_platform_interface
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues 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 ## 1.0.0
Initial release. Initial release.

View File

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

View File

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

View File

@ -1,6 +1,6 @@
name: flutter_inappwebview 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. 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/ homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview repository: https://github.com/pichillilorenzo/flutter_inappwebview
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
@ -18,11 +18,11 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_inappwebview_platform_interface: ^1.0.0 flutter_inappwebview_platform_interface: ^1.0.2
flutter_inappwebview_android: ^1.0.0 flutter_inappwebview_android: ^1.0.2
flutter_inappwebview_ios: ^1.0.0 flutter_inappwebview_ios: ^1.0.2
flutter_inappwebview_macos: ^1.0.0 flutter_inappwebview_macos: ^1.0.1
flutter_inappwebview_web: ^1.0.0 flutter_inappwebview_web: ^1.0.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: