Merge branch 'master' into fix_ios_multiple_flutter_presenting_error

This commit is contained in:
Lorenzo Pichilli 2023-11-10 11:27:15 +01:00 committed by GitHub
commit 8c9a11d14c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 72 additions and 19 deletions

View File

@ -657,6 +657,24 @@
"contributions": [ "contributions": [
"code" "code"
] ]
},
{
"login": "nesquikm",
"name": "nesquikm",
"avatar_url": "https://avatars.githubusercontent.com/u/3867874?v=4",
"profile": "https://github.com/nesquikm",
"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, "contributorsPerLine": 7,

View File

@ -1,6 +1,13 @@
## 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 ## 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 "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 ## 6.0.0-beta.24+1
@ -221,6 +228,10 @@
- Removed `URLProtectionSpace.iosIsProxy` property - Removed `URLProtectionSpace.iosIsProxy` property
- `historyUrl` and `baseUrl` of `InAppWebViewInitialData` can be `null` - `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 ## 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) - Fixed "Xiaomi store - Conflict of Privacy Permissions, android.permission.MY_READ_INSTALLED_PACKAGES" [#1462](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1462)

View File

@ -5,7 +5,7 @@
![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/195422744-bdcfed16-73f0-4bc9-94ab-ecf10771a1c4.png) ![InAppWebView-logo](https://user-images.githubusercontent.com/5956938/195422744-bdcfed16-73f0-4bc9-94ab-ecf10771a1c4.png)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![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-74-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- ALL-CONTRIBUTORS-BADGE:END -->
[![Pub](https://img.shields.io/pub/v/flutter_inappwebview?include_prereleases)](https://pub.dartlang.org/packages/flutter_inappwebview) [![Pub](https://img.shields.io/pub/v/flutter_inappwebview?include_prereleases)](https://pub.dartlang.org/packages/flutter_inappwebview)
@ -175,6 +175,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr> <tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.guide.inc"><img src="https://avatars.githubusercontent.com/u/106543148?v=4?s=100" width="100px;" alt="Guide.inc"/><br /><sub><b>Guide.inc</b></sub></a><br /><a href="https://github.com/pichillilorenzo/flutter_inappwebview/commits?author=guide-flutter" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://www.guide.inc"><img src="https://avatars.githubusercontent.com/u/106543148?v=4?s=100" width="100px;" alt="Guide.inc"/><br /><sub><b>Guide.inc</b></sub></a><br /><a href="https://github.com/pichillilorenzo/flutter_inappwebview/commits?author=guide-flutter" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Nirajn2311"><img src="https://avatars.githubusercontent.com/u/36357875?v=4?s=100" width="100px;" alt="Niraj Nandish"/><br /><sub><b>Niraj Nandish</b></sub></a><br /><a href="https://github.com/pichillilorenzo/flutter_inappwebview/commits?author=Nirajn2311" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Nirajn2311"><img src="https://avatars.githubusercontent.com/u/36357875?v=4?s=100" width="100px;" alt="Niraj Nandish"/><br /><sub><b>Niraj Nandish</b></sub></a><br /><a href="https://github.com/pichillilorenzo/flutter_inappwebview/commits?author=Nirajn2311" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nesquikm"><img src="https://avatars.githubusercontent.com/u/3867874?v=4?s=100" width="100px;" alt="nesquikm"/><br /><sub><b>nesquikm</b></sub></a><br /><a href="https://github.com/pichillilorenzo/flutter_inappwebview/commits?author=nesquikm" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andreasgangso"><img src="https://avatars.githubusercontent.com/u/727125?v=4?s=100" width="100px;" alt="Andreas Gangsø"/><br /><sub><b>Andreas Gangsø</b></sub></a><br /><a href="https://github.com/pichillilorenzo/flutter_inappwebview/commits?author=andreasgangso" title="Code">💻</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -49,8 +49,8 @@ android {
} }
} }
dependencies { dependencies {
implementation 'androidx.webkit:webkit:1.6.1' implementation 'androidx.webkit:webkit:1.8.0'
implementation 'androidx.browser:browser:1.5.0' implementation 'androidx.browser:browser:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
} }

View File

@ -32,14 +32,14 @@ android {
targetCompatibility 1.8 targetCompatibility 1.8
} }
compileSdkVersion 33 compileSdkVersion 34
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.pichillilorenzo.flutter_inappwebviewexample" applicationId "com.pichillilorenzo.flutter_inappwebviewexample"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 33 targetSdkVersion 34
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -40,7 +40,7 @@ void openAndClose() {
activityButton: ActivityButton( activityButton: ActivityButton(
templateImage: UIImage(systemName: "sun.max"), templateImage: UIImage(systemName: "sun.max"),
extensionIdentifier: extensionIdentifier:
"com.pichillilorenzo.flutter-inappwebview-example7.test"))); "com.pichillilorenzo.flutter-inappwebview-example1.test")));
await chromeSafariBrowser.opened.future; await chromeSafariBrowser.opened.future;
expect(chromeSafariBrowser.isOpened(), true); expect(chromeSafariBrowser.isOpened(), true);
expect(() async { expect(() async {

View File

@ -208,9 +208,9 @@
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
6174FE1725CEB74E00A5020C /* Embed Foundation Extensions */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
6174FE1725CEB74E00A5020C /* Embed Foundation Extensions */,
DFFD8453B8E169BF6BE74B49 /* [CP] Embed Pods Frameworks */, DFFD8453B8E169BF6BE74B49 /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
@ -231,7 +231,7 @@
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES; BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1400; LastSwiftUpdateCheck = 1400;
LastUpgradeCheck = 1300; LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = { TargetAttributes = {
6143FF34290959650014A1FC = { 6143FF34290959650014A1FC = {
@ -241,7 +241,6 @@
}; };
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = PFP8UV45Y6;
LastSwiftMigration = 1020; LastSwiftMigration = 1020;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
SystemCapabilities = { SystemCapabilities = {
@ -461,7 +460,7 @@
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; 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)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@ -498,7 +497,7 @@
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES; 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)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
@ -647,7 +646,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example7"; PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example1";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -682,7 +681,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example7"; PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-example1";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1300" LastUpgradeVersion = "1430"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -10,6 +10,7 @@ import Foundation
public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory { public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory {
static let VIEW_TYPE_ID = "com.pichillilorenzo/flutter_inappwebview" static let VIEW_TYPE_ID = "com.pichillilorenzo/flutter_inappwebview"
private var plugin: SwiftFlutterPlugin private var plugin: SwiftFlutterPlugin
init(plugin: SwiftFlutterPlugin) { init(plugin: SwiftFlutterPlugin) {
@ -28,6 +29,7 @@ public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory {
let keepAliveId = arguments?["keepAliveId"] as? String let keepAliveId = arguments?["keepAliveId"] as? String
let headlessWebViewId = arguments?["headlessWebViewId"] as? String let headlessWebViewId = arguments?["headlessWebViewId"] as? String
let preventGestureDelay = arguments?["preventGestureDelay"] as? Bool ?? false
if let headlessWebViewId = headlessWebViewId, if let headlessWebViewId = headlessWebViewId,
let headlessWebView = plugin.headlessInAppWebViewManager?.webViews[headlessWebViewId], let headlessWebView = plugin.headlessInAppWebViewManager?.webViews[headlessWebViewId],
@ -61,6 +63,8 @@ public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory {
plugin.inAppWebViewManager?.keepAliveWebViews[keepAliveId] = flutterWebView! plugin.inAppWebViewManager?.keepAliveWebViews[keepAliveId] = flutterWebView!
} }
flutterWebView?.webView()?.preventGestureDelay = preventGestureDelay
if shouldMakeInitialLoad { if shouldMakeInitialLoad {
flutterWebView?.makeInitialLoad(params: arguments!) flutterWebView?.makeInitialLoad(params: arguments!)
} }

View File

@ -29,6 +29,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
var webMessageListeners: [WebMessageListener] = [] var webMessageListeners: [WebMessageListener] = []
var currentOriginalUrl: URL? var currentOriginalUrl: URL?
var inFullscreen = false var inFullscreen = false
var preventGestureDelay = false
static var sslCertificatesMap: [String: SslCertificate] = [:] // [URL host name : SslCertificate] static var sslCertificatesMap: [String: SslCertificate] = [:] // [URL host name : SslCertificate]
static var credentialsProposed: [URLCredential] = [] static var credentialsProposed: [URLCredential] = []
@ -240,6 +241,15 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate,
} }
} }
// https://github.com/pichillilorenzo/flutter_inappwebview/pull/1665
if preventGestureDelay, let gestures = superview?.superview?.gestureRecognizers {
for gesture in gestures {
if NSStringFromClass(type(of: gesture)) == "DelayingGestureRecognizer" {
gesture.isEnabled = false
}
}
}
return super.hitTest(point, with: event) return super.hitTest(point, with: event)
} }

View File

@ -28,12 +28,12 @@ A new Flutter plugin.
} }
s.swift_version = '5.0' s.swift_version = '5.0'
s.platforms = { :ios => '11.0' } s.platforms = { :ios => '11.0' }
s.dependency 'OrderedSet', '~>5.0' s.dependency 'OrderedSet', '~>5.0'
s.default_subspec = 'Core' s.default_subspec = 'Core'
s.subspec 'Core' do |core| s.subspec 'Core' do |core|
core.platform = :ios, '9.0' core.platform = :ios, '9.0'
end end

View File

@ -65,6 +65,13 @@ class InAppWebView extends StatefulWidget implements WebView {
///- iOS ///- iOS
final InAppWebViewKeepAlive? keepAlive; final InAppWebViewKeepAlive? keepAlive;
///Used to prevent gesture delay on iOS caused by Flutter's gestures handling
///between native/platform views.
///
///**Supported Platforms/Implementations**:
///- iOS
final bool? preventGestureDelay;
///{@macro flutter_inappwebview.InAppWebView} ///{@macro flutter_inappwebview.InAppWebView}
const InAppWebView({ const InAppWebView({
Key? key, Key? key,
@ -178,6 +185,7 @@ class InAppWebView extends StatefulWidget implements WebView {
this.onContentSizeChanged, this.onContentSizeChanged,
this.gestureRecognizers, this.gestureRecognizers,
this.headlessWebView, this.headlessWebView,
this.preventGestureDelay,
}) : super(key: key); }) : super(key: key);
@override @override
@ -807,7 +815,8 @@ class _InAppWebViewState extends State<InAppWebView> {
'initialUserScripts': 'initialUserScripts':
widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [], widget.initialUserScripts?.map((e) => e.toMap()).toList() ?? [],
'pullToRefreshSettings': pullToRefreshSettings, 'pullToRefreshSettings': pullToRefreshSettings,
'keepAliveId': widget.keepAlive?.id 'keepAliveId': widget.keepAlive?.id,
'preventGestureDelay': widget.preventGestureDelay
}, },
creationParamsCodec: const StandardMessageCodec(), creationParamsCodec: const StandardMessageCodec(),
); );

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.25 version: 6.0.0-beta.26
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