Skip to content

Commit 181742b

Browse files
committed
Add documentation and small script to test external deep links.
1 parent 0fb89bd commit 181742b

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

docs/deeplink.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Element X Android deeplink
2+
3+
<!--- TOC -->
4+
5+
* [Introduction](#introduction)
6+
* [Asset Links](#asset-links)
7+
* [Supported links](#supported-links)
8+
* [Developer tools](#developer-tools)
9+
10+
<!--- END -->
11+
12+
13+
## Introduction
14+
15+
Element X Android supports deep linking to specific screens in the application. This document explains how to use deep links in Element X Android.
16+
17+
### Asset Links
18+
19+
The asset links file is available at https://element.io/.well-known/assetlinks.json
20+
21+
### Supported links
22+
23+
Element Call link:
24+
> https://call.element.io/Example
25+
26+
Link to a user:
27+
> https://app.element.io/#/user/@alice:matrix.org
28+
29+
Link to a room by id or alias:
30+
> https://app.element.io/#/room/!roomid:matrix.org
31+
> https://app.element.io/#/room/#element-x-android:matrix.org
32+
33+
Link to a room with a specific event:
34+
> https://app.element.io/#/room/!roomid:matrix.org/$eventid
35+
36+
Note that it will also work with other domain such as:
37+
> https://mobile.element.io
38+
> https://develop.element.io
39+
> https://staging.element.io
40+
41+
## Developer tools
42+
43+
Using an Android 12 or higher emulator
44+
45+
Ensure links verification is enabled
46+
```bash
47+
adb shell am compat enable 175408749 io.element.android.x.debug
48+
```
49+
50+
Reset link verifications for the given package id
51+
```bash
52+
adb shell pm set-app-links --package io.element.android.x.debug 0 all
53+
```
54+
55+
Force the package id links to be verified
56+
```bash
57+
adb shell pm verify-app-links --re-verify io.element.android.x.debug
58+
```
59+
60+
Print the link verification of the package id
61+
```bash
62+
adb shell pm get-app-links io.element.android.x.debug
63+
```
64+
65+
```
66+
io.element.android.x.debug:
67+
ID: e2ece472-c266-4bf0-829c-be79959a6270
68+
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]
69+
Domain verification state:
70+
*.element.io: 1024
71+
```

tools/adb/deeplink_external.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! /bin/bash
2+
#
3+
# Copyright (c) 2024 New Vector Ltd
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE \
19+
-d "https://app.element.io/#/room/!cuqHozLHNBgupgLMKN:matrix.org/%24LZDOueY3R8OD2ZYf8FLKtu95aF7imLBC3F5TIUj-4cc"

0 commit comments

Comments
 (0)