Publishing your PWA in the Play Store in a couple of minutes using PWA Builder

During our last PWA Builder release, we recently announced a new feature to generate from your PWA a signed APK. It’s fully generated from the cloud, no need to install anything on your machine such as Android Studio and it’s ready to be published directly to the Play Store!

Let me show how easy it is. In a couple of minutes, you will be able to submit your PWA to the Google Play Store.

But before that, first question you may ask: why would I publish my PWA in a Store? Isn’t the beauty of PWAs to potentially replace native applications from apps stores by being installed directly from the browser? Yes, indeed! But as an app developer, you should try to reach all possible users, wherever they are and go.

Users often search for a specific application through the store of their device. Publishing a PWA in apps’ stores, either in the Microsoft Store, the Samsung Galaxy Store or the Play Store, offers the following advantages: discoverability, trustworthiness, easy install and business insights as you will be able to get some analytics from the stores dashboards. View it as another way to distribute your PWA. Your users will be able to find your app directly from a browser via a link, from a search engine or from the apps stores! You will target all those channels with a unique code base and unique hosting of your PWA.

Before jumping into the steps of generating your package for the Play Store, let me first explain you what a Trusted Web Activities (TWA) is. What the heck?!? Yet, another acronym! Don’t panic, the concept is simple. It’s a way to publish your PWA as an APK to the Play Store. Once you’ll click the “Install” button from the store, you will have an identical behavior as if you would have installed your PWA directly from the browser. In order to prove you’re the owner of the PWA / website published in the Play Store, you must create a digital asset link associated to the submitted APK at the root of your website, under a specific folder. You can read more about this: Using Trusted Web Activities. PWA Builder is going to simplify a lot this process!

On my side, I’ve followed those steps to publish my small PWA game Apples Crusher into the Play Store. Don’t hesitate to install it on your Android phone to check how this works. By the way, I’ve already blogged about how I’ve made this game: Using WebGL and PWA to build an adaptive game for touch, mouse and VR devices. But any PWA will work.

Step 1: submit your PWA URL to PWA Builder

Navigate to https://www.pwabuilder.com, enter the URL of your PWA and click “Start”:

We will then analyze your PWA and suggest possible enhancement if needed for your manifest or service worker.

If your score is already high enough, you can click on “Build My PWA”.

Then choose the Android platform and click “Download”. It will start the building process of our signed APK on our servers and once done, you’ll be able to explore the downloaded ZIP archive.

Step 2: test your APK on your Android phone

First, you will have to enable the developer mode on your phone and also allow the installation of apps from unknown sources in your settings.  

Then, you have 2 ways to proceed. If you’ve generated the signed APK from a desktop machine, copy your downloaded signed APK on your Android phone via USB and install it.

But you’ve got an even better solution than USB… Simply do everything on your Android device via the browser and PWA Builder! Look at this video to see how I’m packaging our own PWA as an APK and install it directly from my phone:

Generating and installing a signed APK from your PWA in less than 45s!

You can even submit this APK to the Store still from your mobile. How cool is that? 😊

Step 3: create the digital assets link and put in on your webserver

As you may have noticed in the previous video, once our generated APK is launched, the PWA is shown with the address bar. Obviously, this is something you’d like to remove in order to have a full app like experience. For that, you need to prove you’re the owner of the PWA and associate it to your signed APK.

When you will download our ZIP archive from our site containing the signed APK, you’ll find also the next steps in the “Next-steps.md” file pointing to: Creating your asset link file. In a nutshell, you need to:

  1. Download & launch this Android app from the Play Store: Peter’s Asset Link Tool
  2. Select your installed signed APK containing your PWA
  3. Generate the Digital Asset Link and copy the content into a file named assetslinks.json under a folder named .well-known at the root of your PWA.   
Generating the digital asset link from your signed APK

In the case of my PWA Apples Crusher game, it’s living here: https://applescrusher.azurewebsites.net/.well-known/assetlinks.json

Step 4: publish to the Play Store

You’re ready to publish your APK to the Play Store! For that simply follow the Google documentation: Upload an app.

You will have a couple of screenshots to provide, to answer some questions about your app category, policy and so on. Please note you will have a warning after having uploaded our signed APK. It will say it’s not optimized. You can discard this warning; it won’t prevent you to publish.

A couple of hours – days later, once your PWA will have been validated by Google, it will be in the Play Store, congrats!

Please reach out either via our official Twitter account or on our github for any feedback.

Feel free to have a look to other platforms we’re building for as well as to the various components that could improve your PWA.

12 thoughts on “Publishing your PWA in the Play Store in a couple of minutes using PWA Builder

  1. Hello, I hope you are doing great.

    I generated the app using the PWA Builder and uploaded the apk to the play store using my dev console. And used the “Let Google manage and protect your app signing key.” Now my app is live now but it is showing the loading/status bar. Is there any way to fix the issue? My store is built using Shopify and it doesn’t allow access – .well-known at the root level.

    need some alternative options to verify digital asset links for SAS based e-commerce platforms like Shopify that doesn’t provide the root access to the users.

    Please help, my app is live 🙁

    My store is built using Shopify.

    Waiting for a positive response soon.

  2. hi, i can’t work with service worker, i have a wordpress site, and i don’t know where to insert the JS generated files and where to copy the code …
    the APK file generates it anyway, but the internet address bar is always present, I can’t make it disappear …

    Thanks
    Bruno

    1. Hi, is your WordPress site hosted on WordPress or other managed service? If so, I’m afraid you won’t be able to put in place our service worker nor the digital asset link file to remove the address bar. There are some plug-ins to enable Service Worker on WordPress. I’m using SuperPWA on this blog for instance. But I do control the hosting so I can do whatever I like with WordPress.

      1. Hi, thanks for the reply, I installed the SuperPwa and it works, but the address bar remains.
        My site is hosted on Aruba.

        Thanks for everything you have been very helpful.
        Bruno

        1. You’re welcome. You have to put the assetslinks.json file (associated to the right key of your signed APK) under a folder named .well-known at the root of your PWA web server. You should contact Aruba support if you don’t know how to do it.

          1. Just to let you know. I used the service, and it worked very smoothly. No effort on my part. Before that, I had used pwa2apk, yet I got stuck. Then I attempted to do it by myself, with Android Studio and the boilerplate app, and I got stuck too. Finally things worked after I found your article. Thanks a bunch.

  3. Hi, David!
    Thanks for so useful manual.
    One more thing, could you recommend some articles or resources on how to set up push notification in this type of PWA?

    Thanks in Advance,

  4. Hi, I have a question, what if I have an existing app published on play store, created using web2app and android studio. Can I update that existing app with this pwa app. Basically I don’t want to loose the previous app users who already installed that app, I want to make an update so that existing users update my new pwa app over the previous one. Hiw is that possible?

Leave a Reply to bruno davi Cancel reply

Your email address will not be published. Required fields are marked *