Understandably, Progressive web apps(PWA) are added to home screen after the user visits the web app in supported browser(chrome for now I guess) and clicks on "Add to Home Screen". This works fine for publicly available PWAs.
Thinking of Enterprise android applications, which needs to be installed to thousands of devices via some app push tools like Airwatch, its practically not possible to have someone open the browser, put the URL and then add to home screen in all thousands of devices.
Is there any other way to automate this deploy/add icon to home screen of a Progressive web app, not needing user to visit the web app in browser and clicking on "Add to Home Screen" ?
One option we thought about is wrapping in Cordova. But trying to find a solution without such wrapper.
Chrome for Android generates and signs .apk file on the fly using WebPack, when the user clicks on "Add to Home screen" (from menu or install banner) option and if the site has a valid manifest.json and service worker.
Extracting and distributing APK: This .apk can be located and exported to desktop using file explorer tools like ES File Explorer. For some reason, some of default file explorer tools couldn't locate this .apk file. Once exported, this .apk can be used to distribute in controlled environment..like in enterprise devices, where you can enforce the deceive to have Chrome Browser. If this .apk is installed to devices which don't have Chrome browser, user will get a message saying "Chrome" is required to open this app. Once installed, installed PWA apk can be used.
For distributing PWA apps through Play store, google is streamlining the process. A google engineers repose on building APKs (March-2018), when we reached out to them for our enterprise needs.
"Well done extracting the APK and deploying it, it should give a good experience to end users, but I agree it shouldn't be that complicated to deploy web apps on Android.
We are currently working on a streamlined web apps feature, with which you wouldn't need to manipulate or build APKs. This feature will be available on managed devices using Play to deliver apps"
Alternate options: If you think your user base may not have Chrome or don't want to rely on that dependency, wrapping with Cordova kind of hybrid solution is the only way to build your PWA apps for distribution in app stores. With this option, if the "webpack" in the device has the version 40+, user will get PWA benefits. Otherwise, it will still work as a regular hosted web app.
Update on TWA - Trusted web activity Chrome team announced TWA as a solution to these kind of PWA delivery solution and will be part of Chrome 69. But its still not out even in version 70. Heard from Chrome team that this is not prioritized at least until Chrome 71. Even with that, support for private web app is still uncertain. This would be the ideal solution for many enterprise apps. Unfortunately, not in priority list for Chrome team
Trusted Web activities are a new way to integrate your web-app content such as your PWA with your Android app using a similar protocol to Chrome Custom Tabs.
https://developers.google.com/web/updates/2017/10/using-twaTrusted Web activities