Skip to content

Instantly share code, notes, and snippets.

@raystatic
Created July 9, 2022 20:52
Show Gist options
  • Save raystatic/5eebc539f50c6bc34ddd044137da11e2 to your computer and use it in GitHub Desktop.
Save raystatic/5eebc539f50c6bc34ddd044137da11e2 to your computer and use it in GitHub Desktop.
@Singleton
class Feature02DeeplinkProcessor @Inject constructor(
private val context: Context
) : DeeplinkProcessor {
override fun matches(deeplink: String): Boolean {
return deeplink.contains("/feat02")
}
override fun execute(deeplink: String) {
val extraData = deeplink.split("/feat02/").getOrNull(1)
val intent = Intent(context, Feature02Activity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("extraData",extraData)
context.startActivity(intent)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment