-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[url_launcher] Add non-browser URL launch mode for Android #5953
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission! We'll need to hold off briefly on reviewing this, since we should do #5966 first. That will allow implementing this for the new functionality without changing the legacy API's behavior on Android (which we don't want to do since that legacy API is very iOS-centric). It will also mean that the Android implementation doesn't need to use the iOS term internally, which may be confusing for maintenance.
/// This setting is used to require universal links to open in a non-browser | ||
/// application. | ||
/// - [LaunchMode.externalNonBrowserApplication] is supported on iOS 10+ and | ||
/// Android. This setting is used to require universal links to open in a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will need to be a separate PR, since you need to update the minimum Android implementation package version to say this.
The PR referenced above has landed, so you can update this to implement the new API now. (It won't currently work from the app-facing package, but that will be resolved shortly with #5985 so development of this can proceed in parallel.) |
The app-facing package PR has also landed, so an updated version of this would work end to end. |
@Mosc Are you planning on updating this PR to implement use the new API? |
Yes, but it's bit low on my priority list, and with limited time available I haven't got around to restructuring the PR yet. I would not mind if you or someone else takes over in the meantime. |
@Mosc I'm going to close this PR for now to get it off our review queue, but please don't hesitate to submit a new PR if you have the time to get back to it. In the meantime I'll mention this PR on the issue so that anyone else who wants to pick it up can do so. Thanks again for your contribution! |
Adds support for
LaunchMode.externalNonBrowserApplication
tourl_launcher
on Android by acting on theuniversalLinksOnly
parameter that was already being passed to the method channel. Simply addsIntent.FLAG_ACTIVITY_REQUIRE_NON_BROWSER
on Android R and up, but requires a fallback on lower versions. The fallback works by querying the package manager for which apps can handle the intent, and only considering those apps that don't handle just any HTTPS URL. If the resulting list is non-empty, a suitable non-browser app has been found.Fixes flutter/flutter#66721.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.