Skip to content

Use encodedQuery for deep link URLs in MainActivity#152

Open
blessedzulu wants to merge 1 commit into
NativePHP:mainfrom
blessedzulu:fix/preserve-encoded-query
Open

Use encodedQuery for deep link URLs in MainActivity#152
blessedzulu wants to merge 1 commit into
NativePHP:mainfrom
blessedzulu:fix/preserve-encoded-query

Conversation

@blessedzulu

Copy link
Copy Markdown

handleDeepLinkIntent builds the in-app URL from uri.query, which returns the decoded query string. That corrupts URL-encoded parameters - e.g. bracketed array keys like foo[0][bar] (how Livewire serialises array #[Url] props) - when the URL is rebuilt and reloaded into the WebView, so those params arrive empty on deep-linked pages while plain scalars survive.

Switching to uri.encodedQuery preserves the original encoding. This matches the queryString = request.url.encodedQuery handling already on main in PHPWebViewClient; this just applies the same to the two URL builders in MainActivity (universal link + FCM).

uri.query returns the decoded query string, which corrupts URL-encoded
parameters (e.g. bracketed array keys like foo[0][bar]) when the deep
link URL is rebuilt and reloaded into the WebView. Use encodedQuery to
preserve the original encoding, matching the queryString handling already
used in PHPWebViewClient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant