WebAPK ignores display:standalone flag for PWA run

2019-06-11 17:03发布

I am developing a PWA for which I want to have "add to home screen" (a2hs) functionality in standalone display mode.

During development, my PWA is running on a server which is accessible from within my local network only (not from outer internet).

When testing a2hs on Chrome for Android, I encounter the following strange behavior.

Simple add to home screen When my PWA is added to the home screen as a normal shortcut, then everything works fine. Clicking on the shortcut will open the PWA in standalone display mode (without Chrome UI visible).

Advanced add to home screen (WebAPK) When the PWA is added to the home screen as a WebAPK shortcut, then the standalone flag in my web manifest is ignored. Clicking on the shortcut will open the PWA within a browser tab (with Chrome UI visible).

What could be the reason of this incorrect behavior? My guess is that Google's servers need to be able to access my PWA's manifest in order to properly assemble the WebAPK. Since my manifest is not accessible from internet, the WebAPK is not correctly assembled. This is just guessing though. Can someone confirm or describe the reason for this strange behavior?

2条回答
疯言疯语
2楼-- · 2019-06-11 17:34

You PWA can be in complete private network(we have one) and still work as a installable (WebAPK) PWA. Only reason you would be seeing the Chrome UI is, one of the PWA criteria is not met. Run lighthouse report and make sure everything under PWA is passed. Post your audit report if you need help with it.

查看更多
你好瞎i
3楼-- · 2019-06-11 17:36

If you are using a custom port, try using the default port.
Others have reported the same odd behaviour.

This issue was fixed by using the default port.
PWA deployed in node.js running in Standalone mode on Android and iOS

查看更多
登录 后发表回答