简体   繁体   English

PWA:如何在 manifest.json 中使用动态“start_url”

[英]PWA: How to have dynamic "start_url" in manifest.json

I am creating a PWA and stumbled upon a problem with the "start_url" in the manifest.json file.我正在创建 PWA 并偶然发现 manifest.json 文件中的“start_url”有问题。 The website which I am trying to turn into a PWA depends on query params and "start_url":"/" doesn't pick up the query params.我试图变成 PWA 的网站取决于查询参数,而 "start_url":"/" 不会获取查询参数。

I tried deleting the start_url from manifest.json and that seems to allow the app to be added to home screen (on iOS) but I guess on android the install prompt won't appear without the start_url?我尝试从 manifest.json 中删除 start_url,这似乎允许将应用程序添加到主屏幕(在 iOS 上),但我猜在 android 上,如果没有 start_url,安装提示不会出现?

Anyone has experienced a similar issue?任何人都遇到过类似的问题?

You can create a dynamic manifest just like this: https://stackoverflow.com/a/57856162/8716572您可以像这样创建动态清单: https : //stackoverflow.com/a/57856162/8716572

And then you can do something like "start_url": "your-url?query=" + queryValue,然后你可以做类似 "start_url": "your-url?query=" + queryValue,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM