How to create Progressive web app apk/any type of file that can be distributed in a enterprise devices
O

3

8

Understandably, PWAs (Progressive Web Apps) are added to home screen after the user visits the web app in a supported browser 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 the user to visit the web app in a browser, and clicking on "Add to Home Screen" ?

One option we thought about is wrapping in Cordova, but we're trying to find a solution without such wrapper.

Oglethorpe answered 16/3, 2018 at 19:42 Comment(0)
O
19

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. 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 is the official way to pack PWA for Android and its available in Chrome 72 and it also supports private/enterprise web apps as the digital assets validation happens in browser now(it use to happen in cloud, making this solution not possible for private web apps).

Oglethorpe answered 10/4, 2018 at 18:41 Comment(6)
Thanks for this. We have the same problem as the OP here. Will give it a shot later today and see if it works for us!Almondeyed
Thanks for this answer, additionally one can use PWA2APK, appmaker.xyz/pwa-to-apk to make PWA to Playstore ready Android apps.Soonsooner
How did you address the signing issue? When I tried to upload that apk it told me that my signing is not validPiccalilli
We create a certificate and we use that to sign the APK. We also provide the certificate, signed APK, source code, and all its details. Regarding the issue, seems strange. Can you try again, this time screenshot the error and mail to us?Soonsooner
Hi I can not find those Apk via ES File Explorer. Whats the Filename (pattern) and where are they stored?Helium
Should be the same as application name or with a package name which would be com/ org.chromium.<some big number>. I would recommend not use this apk extraction method for distribution and use TWA instead.Oglethorpe
S
4

You can upload the PWA to Playstore using tools like PWA2APK. Just need to share the play store URL to the users, from which they can download PWA app like normal Android App.

Soonsooner answered 4/3, 2019 at 4:17 Comment(0)
M
1

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.

Trusted Web activities

Mello answered 22/7, 2018 at 16:12 Comment(4)
Thank you for the answer. We are currently evaluating this option as wrt enterprise device distribution. Domain validation and play store distribution makes little difference when it comes to enterprise hosted and side loaded apps. Will update here is this solution works. Thanks again for answering.Oglethorpe
This is still not an option as TWA will not work for private web apps as Chrome evaluated TWA criteria in server side, rather than in the browser. Got this confirmation from Chrome team. Things may change post Chrome 69 release. But not an option as of today.Oglethorpe
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.Oglethorpe
@Anand, TWA is supported in the newest chrome update. I see a bright future for PWA apps on Playstore. (Although that's like one step down, still People normally resort to proprietor app stores for keepable apps)Soonsooner

© 2022 - 2024 — McMap. All rights reserved.