问题
At work, we are switching from native app to progressive web app. The last feature that we got before and not with the PWA is that before our application opened automatically at startup of device.
It seems that it not possible (am i wrong ?) with PWA. We are looking to installing an android native application that could launch PWA at startup. But it seems that we need PWA package name or other to launch application.
Did you know if PWA have a package name or other ? Or maybe if we speak more generally, did you think if it's possible ?
回答1:
You need native code here to help start your PWA as your PWA itself cant listen for ACTION_BOOT_COMPLETED, which is needed for you to trigger your app on boot-up. You can create BroadcastReceiverand once you receive ACTION_BOOT_COMPLETED, use Android Intent Filters of your PWA to deep link from your Native code.
If you are thinking of distributing your PWA to non enterprise environment, where installing your Native code is not controlled and guaranteed, I do not see any other way to call your PWA on boot.
来源:https://stackoverflow.com/questions/49694633/progressive-web-app-start-at-android-device-boot