Skip to content

content: Open links externally on iOS #574

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 1 commit into from
Mar 20, 2024

Conversation

rajveermalviya
Copy link
Member

On iOS we prefer LaunchMode.externalApplication because LaunchMode.platformDefault uses SFSafariViewController which provides a weird UX for reasons mentioned in this discussion.

Before After
before after

Fixes: #280

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks @rajveermalviya! This looks good except a couple of formatting nits below. I'll fix those and merge.

(The CI failure is #575. But tools/check passes for me locally, on an appropriate version of Flutter, so all's well.)

@@ -895,7 +896,14 @@ void _launchUrl(BuildContext context, String urlString) async {
bool launched = false;
String? errorMessage;
try {
launched = await ZulipBinding.instance.launchUrl(url);
launched = await ZulipBinding.instance.launchUrl(url, mode: switch (defaultTargetPlatform) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: line too long:

Suggested change
launched = await ZulipBinding.instance.launchUrl(url, mode: switch (defaultTargetPlatform) {
launched = await ZulipBinding.instance.launchUrl(url,
mode: switch (defaultTargetPlatform) {

Comment on lines 900 to 901
// On iOS we prefer LaunchMode.externalApplication because LaunchMode.platformDefault
// uses SFSafariViewController which provides a weird UX for reasons mentioned
Copy link
Member

Choose a reason for hiding this comment

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

nit: lines too long

(and ditto for the same text in the commit message)

On iOS we prefer LaunchMode.externalApplication because (for
HTTP URLs) LaunchMode.platformDefault uses SFSafariViewController,
which gives an awkward UX as described here:
  https://chat.zulip.org/#narrow/stream/48-mobile/topic/in-app.20browser/near/1169118

Fixes: zulip#280
@gnprice gnprice force-pushed the ios-external-link branch from c4d78cd to c4c1a61 Compare March 20, 2024 21:45
@gnprice gnprice merged commit c4c1a61 into zulip:main Mar 20, 2024
@rajveermalviya rajveermalviya deleted the ios-external-link branch March 21, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open links externally by default on iOS
2 participants