I Cant Open Flutter URL Via URL Launcher
109
Solution 1
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
Solution 2
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);
}
Author by
Md. Kaosarul Islam
Updated on January 04, 2023Comments
-
Md. Kaosarul Islam over 1 year
-
gretal almost 2 yearsYou can refer here for a reference.
-
-
Md. Kaosarul Islam almost 2 yearsOk... But Still Link Not Working ... What's Going On .. ibb.co/1qhFtFQ
-
Sulaymon Ne'matov almost 2 yearsIs the internet enabled on the device? It works for me.
-
Harsh Sureja almost 2 yearsWrap with try catch so that you can catch error with app crash and identify error easily