Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@juliocbcotta
Copy link
Contributor

Description

This PR enables the developer to send headers to the Android browser.
This enables the developer to keep the app session in the browser when the same authentication header is used in the app http requests and the in the web site.

Checklist

  • [ X I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@collinjackson
Copy link
Contributor

I've updated the version to a minor (rather than patch) update because you're introducing a new optional argument.

@collinjackson collinjackson self-requested a review July 16, 2019 00:24
Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Since these headers can only be set on Android, the documentation will need to be updated to reflect this.

@collinjackson collinjackson merged commit 19257fb into flutter:master Jul 16, 2019
@juliocbcotta juliocbcotta deleted the plugin/url_launcher branch July 17, 2019 03:38
mithun-mondal pushed a commit to bKash-developer/archived_plugins that referenced this pull request Aug 6, 2019
@Override
@SuppressWarnings("deprecation")
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand why are we overriding this to call loadUrl on versions older than Lolipop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can verify why running the code in different emulators APIs, but the gist of it is that the first method is deprecated and should be used only in older versions of android, at the same time second method only exist in new API versions and they will not call the first one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for following up!

I'm still not sure I understand - what breaks if we don't override shouldOverrideUrlLoading at all?

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 don't quite remember, but I guess that is so the user can navigate using hyperlinks.
I didn't included the call to setWebViewClient, I just fixed the deprecation warning I was getting in Android Studio.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants