Are PWA sites in same domain not able to install both on home screen?

為{幸葍}努か 提交于 2019-12-23 10:09:15

问题


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.

Are there any specifications or limitations to install PWAs on same domain?


回答1:


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/",

and

"scope": "/r/naramap/",

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.




回答2:


If you have two apps in same domain, map it to two different sub-domain with one service works for each of the sub-domain. That will enable you to host it as a two different PWA and both can be added to home screen.

https://s.maplat.jp/r/naramap -> https://naramap.maplat.jp/r/ 

https://s.maplat.jp/r/aizumap -> https://aizumap.maplat.jp/r/


来源:https://stackoverflow.com/questions/50548573/are-pwa-sites-in-same-domain-not-able-to-install-both-on-home-screen

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