Based on what Flutter Deep linking doc describes,
- I have implemented DeepLink with Go_Router.
- I have configured Android Manifest as Set up app links for Android
- and I have configured App Links through Firebase Hosting.
The url for my flutter web looks like this: scheme/host/#/firstScreen
where host could be http://(on local run) or https://(once deployed through firebase).
When user clicks on url link scheme/host/#/firstScreen/secondScreen?id=targetId
on Android device where my flutter app is not installed, it takes to correct page on Chrome. However, when clicking that url link on Android device where my flutter app is installed, my app opens but it throws an error saying
GoException: no routes for location: scheme/host/#/firstScreen/secondScreen?id=targetId
After a couple trials, I figured out that it works well with url link with no hash sign(character #) within the url which looks like scheme/host/firstScreen/secondScreen?id=targetId
. so I decided to remove hash sign #
by
- setPathUrlStrategy() of url_strategy
- usePathUrlStrategy() of flutter_web_plugins
both removes hash sign #
then Deep linking works fine on Android device where my app is installed. However they disables web access that is hosted by Firebase Hosting when entering scheme/host/firstScreen/secondScreen?id=targetId
on Chrome or clicking that url on Android device where my app is not installed showing firebase’s Page Not Found.
So enabling one disables the other.(if accessing url links that contains hash sign #
works either by entering url or clicking url, then deep linking doesn’t work. if deep linking works with url that doesn’t contain hash sign #
, then accessing url links doesn’t work.)
Is there any other approach to make both work? it doesn’t really matter if hash sign # is contained in url as long as deep linking and accessing url link works.
I will appreciate any suggestions to it.