7

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.

allenski
  • 1,652
  • 4
  • 23
  • 39
Anand
  • 9,672
  • 4
  • 55
  • 75

3 Answers3

16

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).

Anand
  • 9,672
  • 4
  • 55
  • 75
  • 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! – SebastianG Aug 16 '18 at 11:33
  • 1
    Thanks for this answer, additionally one can use PWA2APK, https://appmaker.xyz/pwa-to-apk/ to make PWA to Playstore ready Android apps. – Felix josemon Feb 10 '19 at 12:12
  • How did you address the signing issue? When I tried to upload that apk it told me that my signing is not valid – DevArenaCN Feb 21 '19 at 21:44
  • 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? – Felix josemon Mar 04 '19 at 04:11
  • Hi I can not find those Apk via ES File Explorer. Whats the Filename (pattern) and where are they stored? – Flo rian Apr 03 '19 at 12:59
  • Should be the same as application name or with a package name which would be com/ org.chromium.. I would recommend not use this apk extraction method for distribution and use TWA instead. – Anand Apr 03 '19 at 15:48
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.

Felix josemon
  • 932
  • 1
  • 7
  • 14
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

  • 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. – Anand Jul 25 '18 at 21:16
  • 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. – Anand Sep 05 '18 at 14:40
  • 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. – Anand Oct 25 '18 at 19:19
  • @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) – Felix josemon Feb 10 '19 at 12:14