问题
I have created a PWA(Progressive Web App) using Angular6. It works perfectly as expected in the browser. My scenario is to handle all the app data based on the params I get from URL
eg: https://<my-site.com>/app/abc123
where abc123
is my param which I need to add to the home screen app.
So the problem is when user adds the app to the home screen it loses all the params (I have tried using queryparams as well) and that leaves me only with the hostname. I need the whole URL to be added as the App URL. Can you please help.
Thank you for your time and help!
回答1:
When you add a web app to your homescreen, the browser will check to see if there's a web app manifest.
If the manifest is present, the start_url
field in the manifest will be used as the initial page when you open the web app.
If you need to customize the initial page, you'll need to change that start_url
value in your web app manifest accordingly.
来源:https://stackoverflow.com/questions/52328733/pwa-loses-its-params-and-query-params-after-being-added-to-the-home-screen