Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web_view]Expose the allowsLinkPreview property in WKWebView for iOS #5029

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

camfrandsen
Copy link

Based off of flutter/plugins#5110 So most of the credit goes to @b099l3
Also exposed it through the webview_controller

This PR fixes this issue:

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

Based off of flutter/plugins#5110
Also exposed it through the webview_controller
/// Whether to display a preview of the destination for the link
///
/// This is not supported by all platforms, so it defaults to a noop
Future<void> setAllowsLinkPreview(bool allow) async {}
Copy link
Author

@camfrandsen camfrandsen Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was better to default this to a noop so it wouldn't break other platforms if it was called. Having said that, I will change it to whatever you would like

@camfrandsen
Copy link
Author

@cyanglaz @bparrishMines I saw that you reviewed flutter/plugins#5110 the first time. Sorry to make you re-review it... but I would love if you could review this. I did my best to port it over from that pr. Thank you for your help with this!
Note, I checked the Linux and Mac checks, and saw that they had failed on previous pulls that went in, so I am assuming they failing on the main branch? Let me know though if there is something I need to do
@b099l3 I figured you would want to be aware that I have ported your patch over to the new repo

@hellohuanlin hellohuanlin changed the title Expose the allowsLinkPreview property in WKWebView for iOS [web_view]Expose the allowsLinkPreview property in WKWebView for iOS Oct 9, 2023
@MitchellGoodwin
Copy link

cc @bparrishMines

@b099l3
Copy link

b099l3 commented Oct 24, 2023

@camfrandsen No worries, I'm glad it was of some use.

I had a guilt in the back of my mind to come back to it at some point and get it merged. So I can sleep easily now. 😅

@stuartmorgan
Copy link
Contributor

@camfrandsen Please see https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins for how to structure this PR so that it will pass tests. Please let us know if you have any issues setting that up!

# Conflicts:
#	packages/webview_flutter/webview_flutter/CHANGELOG.md
#	packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart
#	packages/webview_flutter/webview_flutter/pubspec.yaml
#	packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md
#	packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFGeneratedWebKitApis.h
#	packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart
#	packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml
#	packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart
@camfrandsen
Copy link
Author

I am splitting this into two pulls since I touched the webview_flutter_platform_interface:
#5292
#5293

@camfrandsen camfrandsen closed this Nov 1, 2023
@stuartmorgan
Copy link
Contributor

I am splitting this into two pulls since I touched the webview_flutter_platform_interface

That's step 3 of the process, which should only be done after the previous steps (which include approvals of the combined PR) are complete.

@camfrandsen
Copy link
Author

@stuartmorgan Ah, sorry about that. I looked at the failures of the checks, and it said that it needed to be broken up... I will re-open this one and close the other two.

@camfrandsen camfrandsen reopened this Nov 1, 2023
Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The webview_flutter_wkwebview portion of this is blocked by flutter/flutter#134777.

# Conflicts:
#	packages/webview_flutter/webview_flutter/CHANGELOG.md
#	packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md
#	packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFGeneratedWebKitApis.h
#	packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebViewHostApi.m
#	packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml
…thod not found: 'FallThroughError'. throw FallThroughError())�dart run pigeon --input pigeons/web_kit.dart
@stuartmorgan
Copy link
Contributor

Update from triage: still waiting on the wrapper generator, which is currently under very active development.

@jmagman jmagman removed the request for review from cyanglaz February 7, 2024 21:57
@hellohuanlin
Copy link
Contributor

hellohuanlin commented Feb 12, 2024

Sounds like this is blocked by other work. I am converting this to draft. feel free to request my review when it's ready.

@hellohuanlin hellohuanlin marked this pull request as draft February 12, 2024 23:35
@ftntming

This comment was marked as off-topic.

@stuartmorgan
Copy link
Contributor

Update from triage: the conversion to the new wrapper automation that this is blocked on is likely to be done sometime around August.

@stuartmorgan
Copy link
Contributor

Update from triage: still likely on track for August.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants