问题描述
我创建了 2 个 PWA 站点
https://s.maplat.jp/r/naramap 和 https://s.maplat.jp/r/aizumap
I created 2 PWA sites
https://s.maplat.jp/r/naramap and https://s.maplat.jp/r/aizumap
但是这些不能一起安装在主屏幕上.
一个安装后,另一个无法安装.
But these are not able to install on home screen together.
Once the one installed, the other cannot install.
在同一域上安装 PWA 是否有任何规范或限制?
Are there any specifications or limitations to install PWAs on same domain?
推荐答案
您可以使用范围应用来完成此任务.更新您的清单文件以包含范围
参数,其值为app"应在其下提供的路径值.
You can accomplish this with scoped apps. Update your manifest files to include a scope
parameter with a value of the path that "app" should be served under.
"scope": "/r/aizumap/",
和
"scope": "/r/naramap/",
您仍然可以使用单个 Service Worker,但每个子应用程序都需要在 start_url
/ 作用域的路径中添加一个尾随
/
工作.
You can still be able to use a single service worker but each sub app will need to have a trailing
/
in it's path for the start_url
/scope
to work.
You can see a sample I've made and the source. It has a parent app, and two sub apps.
这篇关于同一域中的 PWA 站点是否无法在主屏幕上同时安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!