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

Open app by link #9

Open
ezze opened this issue Feb 14, 2022 · 1 comment
Open

Open app by link #9

ezze opened this issue Feb 14, 2022 · 1 comment

Comments

@ezze
Copy link

ezze commented Feb 14, 2022

I wonder whether it's possilbe to support opening the app using intent, e.g. I want to open Telegram channel by tg:// link like it's shown here. Probably, this PR may be related.

At the moment a have the following code snippet relying on url_launcher as a workaround:

Future<void> launchApp({
  required String androidPackageName,
  required String iosUrlScheme,
  required String appStoreLink,
  required String? link,
}) async {
  if (link == null || !await LaunchApp.isAppInstalled(
    androidPackageName: androidPackageName,
    iosUrlScheme: iosUrlScheme,
  )) {
    await LaunchApp.openApp(
      androidPackageName: androidPackageName,
      iosUrlScheme: iosUrlScheme,
      appStoreLink: appStoreLink,
      openStore: true,
    );
    return;
  }

  if (!await canLaunch(link)) {
    return;
  }
  await launch(link);
}
@ezze ezze changed the title Open app by scheme link Open app by intent link Feb 14, 2022
@ezze ezze changed the title Open app by intent link Open app by link Feb 14, 2022
@KrishanMadushanka
Copy link

I used the same workaround @ezze

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

No branches or pull requests

2 participants