Skip to content

[webview_flutter_android] [webview_flutter_wkwebview] Adds support for PlatformNavigationDelegate.onUrlChange #3653

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

Merged
merged 13 commits into from
Apr 12, 2023

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Apr 6, 2023

Platform implementation PR for #3313

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.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@bparrishMines bparrishMines requested a review from cyanglaz as a code owner April 6, 2023 14:39
@bparrishMines bparrishMines changed the title Take from main PR [webview_flutter_android] [webview_flutter_wkwebview] Adds support for PlatformNavigationDelegate.onUrlChange Apr 6, 2023
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM with some minor things.

Be sure to merge in master before landing this to pick up #3648. In this case it's fine to rebaseline (delete the package's lint-baseline.xml, then re-run the repo tool lint-android on the package), because otherwise you'll have to update Pigeon (to pick up the fixes to its generated code), and we shouldn't do that in this PR.

OCMStub([mockUrl absoluteString]).andReturn(@"https://www.google.com");

FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init];
[instanceManager addDartCreatedInstance:mockUrl withIdentifier:0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Wasn't there a recent change that required this to be non-zero, or am I confusing this with something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addDartCreatedInstance should be able to take a 0 since the Dart side reserves all identifiers 0->2^16

/// The codec used by FWFNSUrlHostApi.
NSObject<FlutterMessageCodec> *FWFNSUrlHostApiGetCodec(void);

/// Host API for `NSUrl`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to preserve this for posterity on the PR that actually lands it, I'm not sure NSURL is actually something we should wrap: flutter/plugins#7113 (comment)

(But as I said there, it's fine to land this as-is, just something I want to have a record of when we're looking at the pros and cons of the direct-wrap approach.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll keep this in mind. My main rationale for it was that NSURL has some useful methods/constructors that are unique to iOS.

@bparrishMines bparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 12, 2023
@auto-submit auto-submit bot merged commit d01f4ea into flutter:main Apr 12, 2023
@bparrishMines bparrishMines deleted the url_change_platforms branch April 13, 2023 00:00
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 13, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…r `PlatformNavigationDelegate.onUrlChange` (flutter#3653)

[webview_flutter_android] [webview_flutter_wkwebview] Adds support for `PlatformNavigationDelegate.onUrlChange`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: webview_flutter platform-android platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants