Releasing Multiple PWAs to GooglePlay By Using a Single GitHub Page Root

PWA is pretty exciting. As long as you have a static web hosting service, you can create a mobile app with a web site.

I’ve written a few posts about packaging and releasing an Android app to GooglePlay in the past.

Tips on Creating Android App from PWA

Why Address Bar Is Not Hidden – Android App with TWA

The first app I created was hosted on a GitHub page. Then, I created a second app and wanted to host from the same GitHub page root url with different starting url. It turned out that this was super easy to do. I am pretty sure there are many people out there trying to do the same thing as me. So, if you are interested in publishing multiple apps from a single github.io root url, this is how it works.

(1) Create Folders and set different start URL

First step is to create folders and set different start URLs for each app.

- root
  - app1
    - index.html
    ...
  - app2
    - index.html
    ...

(2) Set different start URL and keep root URL the same in AndroidManifest.xml

When you package apps with Android Studio, you can set two different starting url. But, you can still use the same url for the root.

In AndroidManifest.xml, you can set the url opened by the TWA with the folder name appended to the root url.

android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="https://mygithubusername.github.io/app1/" 

The second app can have a different url to open.

android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="https://mygithubusername.github.io/app2/" 

In strings.xml, we can use the same value for asset statements with different app names.

(3) Add two apps in the same assetlinks.json file

You have .well-known/assetlinks.json in the root. The file takes an array of json object. You can keep appending the apps with their own package names and sha256 cert fingerprints as below. For further information about sharing credentials with apps and sites, you can checkout Google documentation here.

Now, we have multiple apps published from a single github.io page. As you can host static sites for free in github.io, this costs nothing.

Here are the two apps I published from a single github.io url by using this trick.

Sitecore 9 Certification Exam Prep

My To Do

Awesome!

Front-End
TypeScript: type aliases to check type equality

This post is to analyse how the type equality check by using type aliases proposed by Matt Pocock in his twitter post. These type aliases allow us to elegantly express type equality checks in unit tests. All we need to do is to pass the output and expected types in …

Front-End
Fixing it.only type error in Jest

If you are getting a type error with it.only in Jest, it could be due to incorrect TypeScript typings or incompatible versions of Jest and TypeScript. To resolve this issue, you can try the following steps: Make sure you have the latest versions of Jest and its TypeScript typings installed …

Front-End
yup conditional validation example

Here’s an example of a Yup validation logic where the first input field is optional but, if filled, it must contain only alphabetic characters, and the second input field is required: import * as Yup from “yup”; const validationSchema = Yup.object().shape({ firstField: Yup.string().matches(/^[A-Za-z]*$/, { message: “First field must contain only …