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
[url_launcher] Works without doing the configuration of README #102630
Comments
Hi @juri180, Thanks for filing the issue. I suspect that you are directly launching the URLs without querying the apps that can handle the URL. If you try the below code sample without adding queries to manifest, You will get the exception. _launchUrl() async {
final uri = Uri.parse('https://flutter.dev');
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
throw 'Could not launch $uri';
}
} This exception is more common on recent Android versions. It is because the As stated in the doc comments of
|
There is a documentation issue here that I missed when updating the docs for the new API and reworked the discussion of |
@maheshmnj Please don't demonstrate that sample going forward; it's unfortunate that the plugin ever suggested it in the first place, because it's actually an anti-pattern. I've already scrubbed it from the app-facing package, and I'll be updating the implementation packages to match shortly. |
Thanks for your quick responses. @maheshmnj I've tested the package with exactly the same code that you've provided and it worked for me without doing the configuration steps of the README on the test devices mentioned in the first message. I've also checked the Info.plist and AndroidManifest.xml to make sure that it's not already there. @stuartmorgan Do I understand it correctly, that the Configuration section in the README for iOS and Android is indeed not necessary for simple |
Thanks for the feedback @stuartmorgan, I had a misunderstanding that |
There are two parts to answering this:
|
Improves the README section about query permissions: - Removes http/https from the examples; we don't actually expect people to query for http(s) support in general (since generally a browser can assumed to be available), so it's an odd thing to show. - Updates the comments in the Android example to clarify that it's about querying for support, not launching. - Makes the iOS and Android sections have parallel structure so they are easier to read. Fixes flutter/flutter#102630
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The configuration section in the README says that some configuration is necessary on iOS and Android.
<queries>
element to theAndroidManifest.xml
.I tried to use the package for
https
andhttp
without doing the configuration and everything worked. Tested with Android Emulator Pixel 3 API 30 and iPhone 13 iOS 15.2 on Simulator.Why should I do the configuration, if it works also without? Or does it work only because of the Emulator/Simulator? It would be nice to have this in the documentation.
The text was updated successfully, but these errors were encountered: