Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Shell.Current.CurrentState.Location doesn't contain query parameters #15273

Open
powerdude opened this issue Mar 30, 2022 · 1 comment
Open
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@powerdude
Copy link

powerdude commented Mar 30, 2022

Description

When using await Shell.Current.GotoAsync( "page?id=blah" ), query parameters don't seem to be preserved as part of Shell.Current.CurrentState.Location. It makes it difficult to have code like the following work since state can't be properly restored.

public partial class App
{
    protected override void OnStart()
    {
        var myRoute = Preferences.Get("my_route", "");

        if (myRoute != "")
        {
            Shell.Current.GoToAsync(myRoute);
        }
    }

    protected override void OnSleep()
    {
        var myRoute = Shell.Current.CurrentState.Location.ToString();
        Preferences.Set("my_route", myRoute);
    }
}

Steps to Reproduce

  1. Create a shell app
  2. Navigate to a page with a query parameter
  3. check value of Shell.Current.CurrentState.Location

Expected Behavior

Should have the query parameter(s) used to navigate to the page

Actual Behavior

Doesn't have the query parameters

Basic Information

  • Version with issue:
  • Last known good version:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library / AndroidX Version:
  • NuGet Packages:
  • Affected Devices:

Environment

Show/Hide Visual Studio info

Build Logs

Screenshots

Reproduction Link

Workaround

@powerdude powerdude added s/unverified New report that has yet to be verified t/bug 🐛 labels Mar 30, 2022
@powerdude powerdude changed the title [Bug] Shell.CurrentState.Location doesn't contain query parameters [Bug] Shell.Current.CurrentState.Location doesn't contain query parameters Mar 30, 2022
@kofanov
Copy link

kofanov commented Oct 5, 2023

Hello! Did you find any workaround to get parameters?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants