feat(deeplink): point deeplinks at HealthChat hosts

Claims app.healthchat.ch and to.healthchat.ch as App Links, registers the
healthchat:// scheme, and drops the unreachable mobile.element.io handling.
This commit is contained in:
2026-08-03 10:53:35 +02:00
parent d6ea73140e
commit 57a2e585ba
15 changed files with 155 additions and 168 deletions
+40 -20
View File
@@ -1,4 +1,4 @@
# Element X Android deeplink
# HealthChat Android deeplink
<!--- TOC -->
@@ -12,31 +12,45 @@
## Introduction
Element X Android supports deep linking to specific screens in the application. This document explains how to use deep links in Element X Android.
HealthChat Android supports deep linking to specific screens in the application. This document explains how to use deep links in HealthChat Android.
### Asset Links
The asset links file is available at https://element.io/.well-known/assetlinks.json
Two hosts are claimed as verified Android App Links, and each one must serve a matching asset links
file listing `ch.healthchat.element` and the SHA-256 of the Play app signing certificate:
| Host | Asset links file | Served from |
|---|---|---|
| `app.healthchat.ch` | https://app.healthchat.ch/.well-known/assetlinks.json | the `element-web` fork (`apps/web/res/.well-known/assetlinks.json`) |
| `to.healthchat.ch` | https://to.healthchat.ch/.well-known/assetlinks.json | the `healthchat-matrix.to` fork (generated by `scripts/build.js`) |
### Supported links
Element Call link:
> https://call.element.io/Example
Link to a user:
> https://app.element.io/#/user/@alice:matrix.org
> https://to.healthchat.ch/#/@alice:healthchat.ch
> https://app.healthchat.ch/#/user/@alice:healthchat.ch
Link to a room by id or alias:
> https://app.element.io/#/room/!roomid:matrix.org
> https://app.element.io/#/room/#element-x-android:matrix.org
> https://to.healthchat.ch/#/!roomid:healthchat.ch
> https://app.healthchat.ch/#/room/#healthchat:healthchat.ch
Link to a room with a specific event:
> https://app.element.io/#/room/!roomid:matrix.org/$eventid
> https://app.healthchat.ch/#/room/!roomid:healthchat.ch/$eventid
Note that it will also work with other domain such as:
> https://mobile.element.io
> https://develop.element.io
> https://staging.element.io
The HealthChat matrix.to deployment hands out a custom scheme to Android, which is registered too:
> healthchat://room/%23healthchat%3Ahealthchat.ch
> healthchat://user/%40alice%3Ahealthchat.ch
Standard Matrix URIs also work:
> matrix:r/healthchat:healthchat.ch
Only the two hosts above are declared in the manifest, so only those open the app from a browser.
`DefaultMatrixToConverter` is host-agnostic though: any URL using the `/#/room/`, `/#/user/` or
`/#/group/` path, as well as plain matrix.to links, are still resolved once they reach the app
(for instance when tapped inside a message).
Finally, notifications use an internal deep link that is not browsable:
> healthchat://open/{sessionId}/{roomId}/{eventId}
## Developer tools
@@ -44,28 +58,34 @@ Using an Android 12 or higher emulator
Ensure links verification is enabled
```bash
adb shell am compat enable 175408749 io.element.android.x.debug
adb shell am compat enable 175408749 ch.healthchat.element.debug
```
Reset link verifications for the given package id
```bash
adb shell pm set-app-links --package io.element.android.x.debug 0 all
adb shell pm set-app-links --package ch.healthchat.element.debug 0 all
```
Force the package id links to be verified
```bash
adb shell pm verify-app-links --re-verify io.element.android.x.debug
adb shell pm verify-app-links --re-verify ch.healthchat.element.debug
```
Print the link verification of the package id
```bash
adb shell pm get-app-links io.element.android.x.debug
adb shell pm get-app-links ch.healthchat.element.debug
```
```
io.element.android.x.debug:
ch.healthchat.element.debug:
ID: e2ece472-c266-4bf0-829c-be79959a6270
Signatures: [B0:B0:51:DC:56:5C:81:2F:E1:7F:6F:3E:94:5B:4D:79:04:71:23:AB:0D:A6:12:86:76:9E:B2:94:91:97:13:0E]
Domain verification state:
*.element.io: 1024
app.healthchat.ch: verified
to.healthchat.ch: verified
```
Verification only succeeds if the signature above is listed in the asset links files. Release builds
are signed by Google Play, so use the app signing certificate SHA-256 from the Play Console. For a
debug build, add the fingerprint of `app/signature/debug.keystore` (alias `androiddebugkey`) to both
files, or test with `healthchat://` links instead, which need no verification.