Reputation:
My Launcher is not working ! launch (overwitted).. What's the problem here?
Upvotes: 2
Views: 7806
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
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