How to implement Deep Links (App Links) using GitHub as host

Hello everyone,

Today I’m sharing with you a guide on how to implement modern Deep Links, also known as App Links.

In the Android documentation, the use of App Links is recommended for several reasons that make them the best choice nowadays.

The extension we will use is this one from :raising_hands: Glich :raising_hands:


:bookmark: Index

1. Setup GitHub Pages

2. Setup the extension

3. Setup of assetlinks.json

3. Setup the blocks

4. Test

4. Docs


Setup GitHub Pages

Since we will need a GitHub domain for the extension configuration, GitHub Pages will come to our aid by providing us with a free one.

Here the click by click steps:

First, access to GitHub

image



image

It may take a moment and from Actions you can check the status.

Let’s copy the domain because we will need it as an attribute to configure the extension.

test.github.io


Setup the extension

1) android.keystore

To create the assetlinks.json file, the extension generator will need the keystore, so the first thing we need to do is download it.
image

2) Extension generator by Glich



At this point, we will have 2 files

  • the extension com.glich.deeplinkext to upload to Kodular
  • and the assetlinks.json file that we need to place inside the .well-known folder of our GitHub page

Setup of assetlinks.json

Very simply, choose how to create the file

and make sure that

https://yourSubdomain.github.io/.well-known/assetlinks.json

is reachable and responds with the configuration


Setup the blocks

To avoid making things too complicated, we will use a minimal example to make everything work.

In this very simple example, we register Screen1 and, on the DeepLinkReceived event, we display a message with the url.


Test

Now, whenever a link containing

https://test.github.io/something

is opened, the app will open, triggering the DeepLinkExt.DeepLinkReceived event and receiving the URL as a parameter.

Concrete usage example


Docs

Happy :kodular:oding!

2 Likes

Concrete usage example

In this example project, we will use virtual screens and, based on the received deep link, we will open a specific layout among the 3 available in VA_MAIN:

  • VA_LAYOUT1
  • VA_LAYOUT2
  • VA_LAYOUT3.

So, after configuring the extension and GitHub, we will simply need to parse the received URL and, based on the path, open the corresponding layout using the setLayout procedure.