Skip to content

Fix android initial route parsing#1125

Open
ku4sa wants to merge 2 commits intoryanheise:minorfrom
ku4sa:fix-android-initial-route-parsing
Open

Fix android initial route parsing#1125
ku4sa wants to merge 2 commits intoryanheise:minorfrom
ku4sa:fix-android-initial-route-parsing

Conversation

@ku4sa
Copy link
Copy Markdown

@ku4sa ku4sa commented Jun 4, 2025

This PR adds support for preserving URL fragments (the part after #) in deep links when initializing the route in AudioServiceFragmentActivity and AudioServiceActivity.

The change involves adding this line:

if (data.getFragment() != null && !data.getFragment().isEmpty()) {
    initialRoute += "#" + data.getFragment();
}

The modification was made to properly handle deep links containing fragments (e.g., https://example.www/web-player#/tv/groups/allChannels/channel/2/)) when the app is launched from a cold state. Previously, the fragment portion of the URL was being dropped during initial route processing, which could break navigation to specific internal locations.

The change maintains consistency with how query parameters (the part after ?) are already handled, ensuring all parts of a deep link URL (path, query parameters, and fragment) are properly preserved in the initial route.

This fixes an issue where the app would lose the internalPath portion of deep links when launched from a cold state (when the app wasn't already running).

Pre-launch Checklist

  • I read the CONTRIBUTING.md and followed the process outlined there for submitting PRs.
  • My change is not breaking and lands in minor branch OR my change is breaking and lands in major branch.
  • If I'm the first to contribute to the next version, I incremented the version number in pubspec.yaml according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change (format: * DESCRIPTION OF YOUR CHANGE (@your-git-username)).
  • I updated/added relevant documentation (doc comments with ///).
  • I ran dart analyze.
  • I ran dart format.
  • I ran flutter test and all tests are passing.

@SinitBar
Copy link
Copy Markdown

SinitBar commented Jun 6, 2025

Great! It seems to solve my problem!

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.

2 participants