Skip to content

Commit 5c12d62

Browse files
authored
Added details on custom schemes and initialization to doc (#6)
1 parent 692d6ad commit 5c12d62

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,23 @@ If using both Android & iOS, ensure **same addon interface version**.
5757
## <img src="../addon/icon.png" width="20"> Usage
5858
- Add `Deeplink` nodes to your scene per URL association and follow the following steps:
5959
- set the required field on each `Deeplink` node
60-
- `scheme`
61-
- `host`
62-
- `path prefix`
60+
- `scheme` - schemes like `http`, `https`, or a custom scheme (don't include `://`)
61+
- `host` - domain name
62+
- `path prefix` - optional path before link is considered a deeplink
6363
- note that `scheme`, `host`, and `path prefix` must all match for a URI to be processed by the app
6464
- leave `path prefix` empty to process all paths in `host`
6565
- register a listener for the `deeplink_received` signal
6666
- process `url`, `scheme`, `host`, and `path` data from the signal
6767
- invoke the `initialize()` method at startup
68+
- `initialize()` plugin and connect its signals as early as possible (ie. in `_ready()` lifecycle method of your main node)
6869
- alternatively, use the following methods to get most recent deeplink data:
6970
- `get_link_url()` -> full URL for the deeplink
7071
- `get_link_scheme()` -> scheme for the deeplink (ie. 'https')
7172
- `get_link_host()` -> host for the deeplink (ie. 'www.example.com')
7273
- `get_link_path()` -> path for the deeplink (the part that comes after host)
7374
- additional methods:
7475
- `is_domain_associated(a_domain: String)` -> returns true if your application is correctly associated with the given domain on the tested device
76+
- _note: `is_domain_associated()` method does not support custom schemes_
7577
- `navigate_to_open_by_default_settings()` -> navigates to the Android OS' `Open by Default` settings screen for your application
7678

7779
---
@@ -80,7 +82,7 @@ If using both Android & iOS, ensure **same addon interface version**.
8082

8183
## <img src="../addon/icon.png" width="20"> Signals
8284

83-
- `deeplink_received(url: DeeplinkUrl)`: Emitted when app content is requested via deeplink.
85+
- `deeplink_received(url: DeeplinkUrl)`: Emitted when app content is requested via deeplink. Must be connected at startup, as early as possible, or via Godot Editor.
8486

8587
---
8688

@@ -123,11 +125,11 @@ path_prefix = "/my_data"
123125
```
124126

125127
2. **Node-based Export Configuration**
126-
If `export.cfg` file is not found or file-based configuration fails, then the plugin will attempt to load node-based configuration.
128+
If `export.cfg` file is not found or file-based configuration is invalid, then the plugin will attempt to load node-based configuration.
127129

128130
During iOS export, the plugin searches for `Deeplink` nodes in the scene that is open in the Godot Editor. If none found, then the plugin searches for `Deeplink` nodes in the project's main scene. Therefore;
129131
- Make sure that the scene that contains the `Deeplink` node(s) is selected in the Godot Editor when building and exporting for Android, or
130-
- Make sure that your Godot project's main scene contains an `Deeplink` node(s).
132+
- Make sure that your Godot project's main scene contains one or more `Deeplink` nodes.
131133

132134
---
133135

@@ -138,6 +140,7 @@ During iOS export, the plugin searches for `Deeplink` nodes in the scene that is
138140
### Android
139141
- **Build:** [Create custom Android gradle build](https://docs.godotengine.org/en/stable/tutorials/export/android_gradle_build.html).
140142
- **Domain Association:** [Associate Godot app with a domain](https://developer.android.com/studio/write/app-link-indexing#associatesite).
143+
- **Custom schemes:** Chrome has issues opening custom schemes; Firefox is able to open them successfully.
141144
- **Testing:**
142145
1. Use `adb shell` as follows:
143146
- `$> adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://www.example.com/mydata/path"`

0 commit comments

Comments
 (0)