You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.8 KiB
Markdown
39 lines
1.8 KiB
Markdown
|
1 year ago
|
# setDeepLinkSchema
|
||
|
|
|
||
|
|
The setDeepLinkSchema() method allows the specification of a deep link schema for shared locations and points of interest. This is an optional method, and if not provided, the shared location or POI will not be active.
|
||
|
|
|
||
|
|
**Parameters**
|
||
|
|
|
||
|
|
deepLinkSchema: A string containing the desired deep link schema, such as app://www.demo.com.
|
||
|
|
|
||
|
|
## Update AndroidManifest.xml
|
||
|
|
|
||
|
|
The \<data> element in the intent-filter specifies the host and scheme for the deep link.
|
||
|
|
|
||
|
|
The **android:host** attribute is set to **@string/deeplinkHost**, which refers to the deep link host saved in the <u>**strings.xml**</u> file.
|
||
|
|
|
||
|
|
The **android:scheme** attribute is set to **@string/deeplinkSchema**, which refers to the deep link schema saved in the <u>**strings.xml**</u> file.
|
||
|
|
|
||
|
|
This allows the app to respond to deep links with the specified host and schema and handle them with the DeepLinkActivity.
|
||
|
|
|
||
|
|
It is important to ensure that the host and schema are saved correctly in the strings.xml file and that the correct references are used in the \<data> element of the intent-filter.
|
||
|
|
|
||
|
|
```java
|
||
|
|
<activity
|
||
|
|
android:name=".Activity">
|
||
|
|
<intent-filter android:label="@string/app_name">
|
||
|
|
<action android:name="android.intent.action.VIEW" />
|
||
|
|
<data
|
||
|
|
android:host="@string/deeplinkHost"
|
||
|
|
android:scheme="@string/deeplinkSchema" />
|
||
|
|
</intent-filter>
|
||
|
|
</activity>
|
||
|
|
```
|
||
|
|
>Note
|
||
|
|
>- It is recommended to save the deep link host and schema in the strings.xml file for future reference.
|
||
|
|
>- The deep link schema should be provided in the correct format and adhere to the proper syntax for deep links.
|
||
|
|
>- The use of this method is optional and may not be necessary in all cases. if not provided, the shared location or Shared POI will not be actived.
|
||
|
|
|
||
|
|
```java
|
||
|
|
setDeepLinkSchema("app://www.demo.com")
|
||
|
|
```
|