user19196093
user19196093

Reputation:

I Cant Open Flutter URL Via URL Launcher

My Launcher is not working ! launch (overwitted).. What's the problem here?

enter image description here

Upvotes: 2

Views: 7806

Answers (2)

Prabhakaran
Prabhakaran

Reputation: 1544

If you are trying out the URL launcher in Android and the device API is 30+, try adding the query intent outside of the application tag in the Android Manifest.

<queries>
  <intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="https" />
  </intent>
</queries>

Note: Use a stable Gradle version greater than 4 and update the studio to the latest version.

You can refer to: https://pub.dev/packages/url_launcher#android

Upvotes: 7

Sulaymon Ne&#39;matov
Sulaymon Ne&#39;matov

Reputation: 448

The syntax you use is old. You also need to parse the url.

final url = Uri.parse('https://google.com');
    if (await canLaunchUrl(url)) {
      await launchUrl(url);
    }

Upvotes: 2

Related Questions