Closed shadow1007 closed 3 years ago
I find out a solution
I try to use URL encode to replace "&" with "%26"
adb shell 'am start -W -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "mayapp://action?article=1%26lang=en#test"'
Then, in Dart I decode the path string:
_sub = getLinksStream().listen((String link) {
var uri = Uri.parse(link.replaceAll("%26", "&"));
print(uri.queryParameters);
}, onError: (err) {
// Handle exception by warning the user their action did not succeed
});
What I got
got link: mayapp://action?article=1%26lang=en#test
{article: 1, lang: en}
Same here, but your solution it's quite strange. In my case, I used the latest version, if I simulate mayapp://action?article=1%26lang=en#test it would be mayapp://action?article=1%2625lang=en#test.
Same here, but your solution it's quite strange. In my case, I used the latest version, if I simulate mayapp://action?article=1%26lang=en#test it would be mayapp://action?article=1%2625lang=en#test.
Since it does not accept special character like &
, therefore I use URL encode to encode it. All special character in URL will look like %xx
. It the app, the received link should be decoded base on URL encode
. Like, the %26
should be replace by &
. It the only way I know so far, bro.
I'm using [custom schemes] and am testing on my [Android Emulator], which is running [Android 9].
My code in AndroidManifest.xml
and in .dart
I run the command in treminal
adb shell 'am start -W -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "mayapp://action?article=1&lang=en#test"'
my expected result
But what I got is
My flutter verion
When I only add one query parameter, every thing is fine. But when I using '&' in the path, it seen that is ignore all the thing after '&'
I try to use URL encode to replace "&" with "%26" But the result is
Am I do anything wrong with the package?