Skip to content

Deeplink

in Manifest.xml’s activity tag add following config for link wsapp://edu.ws2022.a2/app/worldskills

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="edu.ws2022.a2"
android:path="/app/worldskills"
android:scheme="wsapp" />
</intent-filter>
val uri = intent?.data
// Full URI string
val fullUri = uri?.toString() // "myapp://detail/123?name=John"
// Scheme & host
val scheme = uri?.scheme // "myapp"
val host = uri?.host // "detail"
// Path segments — splits path by "/"
val segments = uri?.pathSegments // ["detail", "123"]
val itemId = uri?.pathSegments?.getOrNull(1) // "123"
// Last path segment
val last = uri?.lastPathSegment // "123"
// Query parameters
val name = uri?.getQueryParameter("name") // "John"
val allParams = uri?.queryParameterNames // Set of all param keys