I have created a simple Flutter Web App and deployed in to Firebase hosting.
I use url_launcher: ^6.0.17 I created a list of links that can be clicked to open in a new window:
dynamic _launchURL() async {
final parsedUrl = Uri(
path: url,
scheme: 'https',
);
if (await canLaunchUrl(parsedUrl)) {
await launchUrl(
parsedUrl,
// mode: LaunchMode.externalApplication,
webOnlyWindowName: "_blank",
);
} else {
throw 'Could not launch $url';
// TODO: open window to copy url
}
}
It works perfectly fine in test chrome/edge but also in emulator and my phone plugged to pc (when debugging from AndroidStudio)
When I deployed to Firebase hosting it behaves in a different way - it appends url I am providing after last slash of my mian page and thus it fails.
e.g. when I am on https://.web.app and click a link I see in browser that it attempts to open https://my app name.app/ target link in a new browser tab
As I am new to firebase I am not even sure how to troubleshoot it - e.g. get app logs etc.
Any help will be appreciated
I tried: googling + stack overflow + playing with url_launcher params + tested on multiple browsers