PWABuilder icon indicating copy to clipboard operation
PWABuilder copied to clipboard

query string does not work in Windows apps

Open drma-tech opened this issue 1 year ago • 5 comments

What happened?

https://www.streamingdiscovery.com/?platform=play
https://www.streamingdiscovery.com/?platform=windows
https://www.streamingdiscovery.com/?platform=amazon

So, I'm generating my apps with different urls, so I can capture these parameters, save them in local storage and then use them on one of my screens. The problem is that in the Windows app this doesn't work.

How do we reproduce the behavior?

if (platform.NotEmpty())
{
    await JsRuntime.InvokeAsync<string>("SetLocalStorage", "platform", platform);
}
else
{
    await JsRuntime.InvokeAsync<string>("SetLocalStorage", "platform", "webapp");
}

image

In the case of Windows, it only generates the webapp, because it cannot capture this query string. In the case of Android, this works normally.

What do you expect to happen?

I believe that the build is excluding the parameters from the url that I enter, only leaving the root, which is why I cannot detect the query strings.

What environment were you using?

windows: last, edge: last, installed from windows store

Additional context

No response

drma-tech avatar Mar 14 '24 12:03 drma-tech

Hey @drma-tech, it is interesting that your query params are not being included in the Windows package. With the store installed version of your app, if you open up devtools, and in the console type window.location, does the URL look right to you?

Second, the best way to know if your PWA is running on Windows, installed from the Store is this https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/microsoft-store#measure-usage-of-your-pwa-installed-from-the-microsoft-store

jgw96 avatar Mar 18 '24 18:03 jgw96

image doesnt show anything

drma-tech avatar Mar 18 '24 18:03 drma-tech

Interesting, ok let me do some exploring and ill get back to you. Thanks!

jgw96 avatar Mar 19 '24 20:03 jgw96

@jgw96 any progreess?

drma-tech avatar May 14 '24 23:05 drma-tech

and I just discovered that it doesn't work on Android either. at least not currently (it worked when I implemented it, i think).

drma-tech avatar May 15 '24 11:05 drma-tech