pwa-builder / PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.
https://docs.pwabuilder.com
Other
2.54k stars 273 forks source link

query string does not work in Windows apps #4681

Open drma-tech opened 3 months ago

drma-tech commented 3 months ago

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

jgw96 commented 3 months ago

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

drma-tech commented 3 months ago

image doesnt show anything

jgw96 commented 3 months ago

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

drma-tech commented 1 month ago

@jgw96 any progreess?

drma-tech commented 1 month ago

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