PWA loses its params and query params after being added to the home screen

空扰寡人 提交于 2020-01-04 03:51:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!