I thought the use of Uri.decodeFull at the start of AppLink.fromLocation(String?) looked a bit suspicious, so I did some experimentation on all platforms. The call is indeed unnecessary, and changes the meaning of the URL if some special characters are present.
If we were to pass in the following URL (just the path on the web):
fooderlich://raywenderlich.com/home?tab=0&candy=M%26M
The expected query parameters after parsing the URI are:
-
tabwith a value of0 -
candywith a value ofM&M
Putting a breakpoint in AppLink.fromLocation, the URL arrives already decoded on iOS and the web. On Android, the %26 has even already been converted back to an &, which must surely be some other bug, but that might have to do with how Iām passing it to adb shell to begin with, so Iām ignoring that one for now.
Long story short, with the pass through Uri.decodeFull(), there are now three query parameters:
-
tabwith a value of0 -
candywith a value ofM -
Mwith no value
Without the call to Uri.decodeFull(), the result of Uri.parse is as expected.