From d1f5a6721c1a6abceff61ee9712464ed6fb2a11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Gangs=C3=B8?= Date: Tue, 23 May 2023 16:54:34 +0200 Subject: [PATCH 1/9] feat(ios): optional tradeoff to fix input delay (#1268) --- ios/Classes/InAppWebView/FlutterWebViewFactory.swift | 1 + ios/Classes/SwiftFlutterPlugin.swift | 1 + lib/src/in_app_webview/in_app_webview.dart | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ios/Classes/InAppWebView/FlutterWebViewFactory.swift b/ios/Classes/InAppWebView/FlutterWebViewFactory.swift index 74a5b2bf..ce06342e 100755 --- a/ios/Classes/InAppWebView/FlutterWebViewFactory.swift +++ b/ios/Classes/InAppWebView/FlutterWebViewFactory.swift @@ -10,6 +10,7 @@ import Foundation public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory { static let VIEW_TYPE_ID = "com.pichillilorenzo/flutter_inappwebview" + static let NON_BLOCKING_VIEW_TYPE_ID = "com.pichillilorenzo/flutter_inappwebview_nonblocking" private var plugin: SwiftFlutterPlugin init(plugin: SwiftFlutterPlugin) { diff --git a/ios/Classes/SwiftFlutterPlugin.swift b/ios/Classes/SwiftFlutterPlugin.swift index 22eaecdc..0cb8e478 100755 --- a/ios/Classes/SwiftFlutterPlugin.swift +++ b/ios/Classes/SwiftFlutterPlugin.swift @@ -44,6 +44,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin { self.registrar = registrar registrar.register(FlutterWebViewFactory(plugin: self) as FlutterPlatformViewFactory, withId: FlutterWebViewFactory.VIEW_TYPE_ID) + registrar.register(FlutterWebViewFactory(plugin: self) as FlutterPlatformViewFactory, withId: FlutterWebViewFactory.NON_BLOCKING_VIEW_TYPE_ID, gestureRecognizersBlockingPolicy:FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded) platformUtil = PlatformUtil(plugin: self) inAppBrowserManager = InAppBrowserManager(plugin: self) diff --git a/lib/src/in_app_webview/in_app_webview.dart b/lib/src/in_app_webview/in_app_webview.dart index e7b2ae90..ae8a7588 100755 --- a/lib/src/in_app_webview/in_app_webview.dart +++ b/lib/src/in_app_webview/in_app_webview.dart @@ -65,6 +65,8 @@ class InAppWebView extends StatefulWidget implements WebView { ///- iOS final InAppWebViewKeepAlive? keepAlive; + final bool? preventGestureDelay; + ///{@macro flutter_inappwebview.InAppWebView} const InAppWebView({ Key? key, @@ -187,6 +189,7 @@ class InAppWebView extends StatefulWidget implements WebView { this.onContentSizeChanged, this.gestureRecognizers, this.headlessWebView, + this.preventGestureDelay, }) : super(key: key); @override @@ -799,8 +802,11 @@ class _InAppWebViewState extends State { }, ); } else if (Util.isIOS /* || Util.isMacOS*/) { + final viewType = widget.preventGestureDelay == true + ? 'com.pichillilorenzo/flutter_inappwebview_nonblocking' + : 'com.pichillilorenzo/flutter_inappwebview'; return UiKitView( - viewType: 'com.pichillilorenzo/flutter_inappwebview', + viewType: viewType, onPlatformViewCreated: _onPlatformViewCreated, gestureRecognizers: widget.gestureRecognizers, creationParams: { From 60da7352f45f2a053c2a1368f253ccd7b1fdebcb Mon Sep 17 00:00:00 2001 From: nesquikm Date: Tue, 26 Sep 2023 12:19:45 +0400 Subject: [PATCH 2/9] fix: xcode 17 related bug --- ios/flutter_inappwebview.podspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ios/flutter_inappwebview.podspec b/ios/flutter_inappwebview.podspec index d7cec322..03e2e86c 100755 --- a/ios/flutter_inappwebview.podspec +++ b/ios/flutter_inappwebview.podspec @@ -29,10 +29,11 @@ A new Flutter plugin. s.swift_version = '5.0' + s.platforms = { :ios => '11.0' } s.dependency 'OrderedSet', '~>5.0' - + s.default_subspec = 'Core' - + s.subspec 'Core' do |core| core.platform = :ios, '9.0' end From 44e70a36284443f01de208ef9aacc05c0a6067dc Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Sat, 30 Sep 2023 19:53:26 +0200 Subject: [PATCH 3/9] Updated androidx.webkit:webkit dependency to 1.8.0, Updated androidx.browser:browser dependency to 1.6.0 --- CHANGELOG.md | 3 +++ android/build.gradle | 4 ++-- example/android/app/build.gradle | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 849299e6..d63a699d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## 6.0.0-beta.25 +- Updated `androidx.webkit:webkit` dependency to `1.8.0` +- Updated `androidx.browser:browser` dependency to `1.6.0` - Merged "feat: InAppLocalhostServer decode assets url when loading them" [#1657](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1657) (thanks to [Nirajn2311](https://github.com/Nirajn2311)) +- Merged "fix: xcode 15 related bug" [#1801](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1801) (thanks to [nesquikm](https://github.com/nesquikm)) ## 6.0.0-beta.24+1 diff --git a/android/build.gradle b/android/build.gradle index 2cfe7d41..5818c71b 100755 --- a/android/build.gradle +++ b/android/build.gradle @@ -49,8 +49,8 @@ android { } } dependencies { - implementation 'androidx.webkit:webkit:1.6.1' - implementation 'androidx.browser:browser:1.5.0' + implementation 'androidx.webkit:webkit:1.8.0' + implementation 'androidx.browser:browser:1.6.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index dadb3354..1a5f9e50 100755 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -32,14 +32,14 @@ android { targetCompatibility 1.8 } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.pichillilorenzo.flutter_inappwebviewexample" minSdkVersion 19 - targetSdkVersion 33 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From f608785a006244dba4c1aa4ffa82f294586de967 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:37:49 +0000 Subject: [PATCH 4/9] update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3262ca5..e5dde146 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/195422744-bdcfed16-73f0-4bc9-94ab-ecf10771a1c4.png) -[![All Contributors](https://img.shields.io/badge/all_contributors-72-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-73-orange.svg?style=flat-square)](#contributors-) [![Pub](https://img.shields.io/pub/v/flutter_inappwebview?include_prereleases)](https://pub.dartlang.org/packages/flutter_inappwebview) @@ -175,6 +175,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Guide.inc
Guide.inc

💻 Niraj Nandish
Niraj Nandish

💻 + nesquikm
nesquikm

💻 From 3591a76b6867f7c3f07b405ff24f06102ec08cb5 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:37:50 +0000 Subject: [PATCH 5/9] update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index cfbee5d5..8b533cd0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -657,6 +657,15 @@ "contributions": [ "code" ] + }, + { + "login": "nesquikm", + "name": "nesquikm", + "avatar_url": "https://avatars.githubusercontent.com/u/3867874?v=4", + "profile": "https://github.com/nesquikm", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, From 0157c8ec7cc1f45adf0b27adcea889f20deff483 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Mon, 2 Oct 2023 23:47:46 +0200 Subject: [PATCH 6/9] updated CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d63a699d..6bb1e6f6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -224,6 +224,10 @@ - Removed `URLProtectionSpace.iosIsProxy` property - `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` +## 5.8.0 + +- Merged "fix: xcode 15 related bug" [#1790](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1790) (thanks to [nesquikm](https://github.com/nesquikm)) + ## 5.7.2+3 - Fixed "Xiaomi store - Conflict of Privacy Permissions, android.permission.MY_READ_INSTALLED_PACKAGES" [#1462](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1462) From a7030772be0cf4b29052d80474e46d3e99b1bc94 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Thu, 9 Nov 2023 19:35:50 +0100 Subject: [PATCH 7/9] updated InAppWebView.preventGestureDelay native implementation for ios --- CHANGELOG.md | 4 ++++ .../chrome_safari_browser/open_and_close.dart | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 13 ++++++------- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../InAppWebView/FlutterWebViewFactory.swift | 5 ++++- ios/Classes/InAppWebView/InAppWebView.swift | 10 ++++++++++ ios/Classes/SwiftFlutterPlugin.swift | 1 - lib/src/in_app_webview/in_app_webview.dart | 13 ++++++++----- pubspec.yaml | 2 +- 9 files changed, 35 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bb1e6f6..24c103b1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.0-beta.26 + +- Merged "feat(ios): optional tradeoff to fix ios input delay" [#1665](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1665) (thanks to [andreasgangso](https://github.com/andreasgangso)) + ## 6.0.0-beta.25 - Updated `androidx.webkit:webkit` dependency to `1.8.0` diff --git a/example/integration_test/chrome_safari_browser/open_and_close.dart b/example/integration_test/chrome_safari_browser/open_and_close.dart index 4439e21e..b29f5aca 100644 --- a/example/integration_test/chrome_safari_browser/open_and_close.dart +++ b/example/integration_test/chrome_safari_browser/open_and_close.dart @@ -40,7 +40,7 @@ void openAndClose() { activityButton: ActivityButton( templateImage: UIImage(systemName: "sun.max"), extensionIdentifier: - "com.pichillilorenzo.flutter-inappwebview-example7.test"))); + "com.pichillilorenzo.flutter-inappwebview-example1.test"))); await chromeSafariBrowser.opened.future; expect(chromeSafariBrowser.isOpened(), true); expect(() async { diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index c6cb5f83..b34f61c2 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -208,9 +208,9 @@ 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, + 6174FE1725CEB74E00A5020C /* Embed Foundation Extensions */, 97C146EC1CF9000F007C117D /* Resources */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 6174FE1725CEB74E00A5020C /* Embed Foundation Extensions */, DFFD8453B8E169BF6BE74B49 /* [CP] Embed Pods Frameworks */, ); buildRules = ( @@ -231,7 +231,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1400; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 6143FF34290959650014A1FC = { @@ -241,7 +241,6 @@ }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = PFP8UV45Y6; LastSwiftMigration = 1020; ProvisioningStyle = Automatic; SystemCapabilities = { @@ -461,7 +460,7 @@ MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example7.test"; + PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example1.test"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -498,7 +497,7 @@ ); MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example7.test"; + PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example1.test"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = YES; @@ -647,7 +646,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example7"; + PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example1"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -682,7 +681,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example7"; + PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example1"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 50a8cfc9..9c585c83 100755 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { }, ); } else if (Util.isIOS /* || Util.isMacOS*/) { - final viewType = widget.preventGestureDelay == true - ? 'com.pichillilorenzo/flutter_inappwebview_nonblocking' - : 'com.pichillilorenzo/flutter_inappwebview'; return UiKitView( - viewType: viewType, + viewType: 'com.pichillilorenzo/flutter_inappwebview', onPlatformViewCreated: _onPlatformViewCreated, gestureRecognizers: widget.gestureRecognizers, creationParams: { @@ -813,7 +815,8 @@ class _InAppWebViewState extends State { 'initialUserScripts': widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], 'pullToRefreshSettings': pullToRefreshSettings, - 'keepAliveId': widget.keepAlive?.id + 'keepAliveId': widget.keepAlive?.id, + 'preventGestureDelay': widget.preventGestureDelay }, creationParamsCodec: const StandardMessageCodec(), ); diff --git a/pubspec.yaml b/pubspec.yaml index 281a2aad..6bb2a2f5 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.25 +version: 6.0.0-beta.26 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues From 995a80710356402fcf669eaff515870ed49d099d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:46:19 +0000 Subject: [PATCH 8/9] update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e5dde146..b08c6e57 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/195422744-bdcfed16-73f0-4bc9-94ab-ecf10771a1c4.png) -[![All Contributors](https://img.shields.io/badge/all_contributors-73-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-74-orange.svg?style=flat-square)](#contributors-) [![Pub](https://img.shields.io/pub/v/flutter_inappwebview?include_prereleases)](https://pub.dartlang.org/packages/flutter_inappwebview) @@ -176,6 +176,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Guide.inc
Guide.inc

💻 Niraj Nandish
Niraj Nandish

💻 nesquikm
nesquikm

💻 + Andreas Gangsø
Andreas Gangsø

💻 From 85dd7251e4ee8559e3cfc8e01032b88ceda10ed2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:46:20 +0000 Subject: [PATCH 9/9] update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8b533cd0..fdc0dfa2 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -666,6 +666,15 @@ "contributions": [ "code" ] + }, + { + "login": "andreasgangso", + "name": "Andreas Gangsø", + "avatar_url": "https://avatars.githubusercontent.com/u/727125?v=4", + "profile": "https://github.com/andreasgangso", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7,