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

Try to control which external browser/app is used on opening a link #74

Open
gnprice opened this issue Apr 19, 2023 · 3 comments
Open
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Apr 19, 2023

This will be a followup to:

@terpimost writes:

I have Safari and Chrome - which browser will be used to open a link? And I have Apple Maps and Google Maps, which app will be used to open a link?

and adds:

It is a minor thing. We can just do system default app

@gnprice
Copy link
Member Author

gnprice commented Apr 19, 2023

On Android, the experience I'm accustomed to as a user is that once I've decided to open something in another app, the app I'm coming from doesn't attempt to specify which particular app I use — instead I get a piece of system UI that asks me, and I choose there. (Including an "always use this app" option, but that's still between me and the system.) It looks like this:
https://developer.android.com/training/basics/intents/sending#disambiguation-dialog

So I think we probably don't want to try to usurp that Android behavior.

On iOS I don't know what the right thing is, though.

@terpimost
Copy link

Hey, it could be that iOS acts similar and I just don't know about it. Lets see how it works just to be aware.

@gnprice
Copy link
Member Author

gnprice commented Aug 17, 2023

On Android, the experience I'm accustomed to as a user is that once I've decided to open something in another app, the app I'm coming from doesn't attempt to specify which particular app I use — instead I get a piece of system UI that asks me, and I choose there.

Hmm, well — I'm no longer seeing that behavior! At least not when I open an https: or http: URL.

On that Android docs page, their own example shows a choice between two browsers:
image
which corroborates my recollection that that was how it routinely worked. But I guess it changed at some point. Most likely that means with Android 13 at the latest, though I've been using that for most of a year.

I first noticed that I wasn't getting this behavior when I implemented #71, using an external browser (LaunchMode.externalApplication) for the reason described at #279. I chalked it up to a quirk in the Flutter url_launcher implementation, which I was perhaps primed to do by that bug described at #279… but just now I looked at the implementation, and what it's doing for LaunchMode.externalApplication seems perfectly canonical. And then I went and tried a couple of other apps, including zulip-mobile with the "Open links with in-app browser" setting turned off, and none of them gave me that choose-which-browser UI.

Specifically, what I get is that the link leads directly to opening in the Chrome app. Which indeed I appear to have set as my default browser on the system.

Anyway, for this issue's purposes the bottom line is the same: on Android there's already a systemwide way to choose the browser, which is under the user's control, so I don't think we'll want to try to usurp that.

gnprice added a commit that referenced this issue Aug 17, 2023
The second TODO, about the behavior of externalApplication, turns out
to be just how things work these days on Android:
  #74 (comment)

The first one, about the behavior of inAppWebView or platformDefault,
I've filed as #279.  I also added a number of details on the upstream
issue, and cross-linked it with a couple of other issues that would
be fixed by the same solution.
@gnprice gnprice added this to the Post-launch milestone May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants