PWA在添加到主屏幕后会丢失其参数并查询参数 [英] PWA loses its params and query params after being added to the home screen

查看:110
本文介绍了PWA在添加到主屏幕后会丢失其参数并查询参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Angular6创建了PWA(Progressive Web App)。它在浏览器中可以按预期完美运行。我的情况是根据从URL获得的参数处理所有应用程序数据

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

例如: https://< my-site。 com> / app / abc123

其中 abc123 是我的参数添加到主屏幕应用程序。

where abc123 is my param which I need to add to the home screen app.

所以问题是,当用户将应用程序添加到主屏幕时,它会丢失所有参数(我也尝试过使用queryparams),剩下的只有主机名。我需要将整个URL添加为App URL。

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!

推荐答案

将网络应用添加到主屏幕时,浏览器将检查是否存在网络应用清单

When you add a web app to your homescreen, the browser will check to see if there's a web app manifest.

如果存在清单,则清单中的 start_url 字段将在您打开Web应用程序时用作初始页面。

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.

如果需要自定义初始页面,则需要相应地更改Web应用清单中的 start_url 值。

If you need to customize the initial page, you'll need to change that start_url value in your web app manifest accordingly.

这篇关于PWA在添加到主屏幕后会丢失其参数并查询参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆