airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.37k stars 407 forks source link

[Question] Get DeeplinkResult without launching activity #304

Open hashlin opened 3 years ago

hashlin commented 3 years ago

I come up with a question as I'm not sure if my usecase is supported or not.

Usecase

What I looked for

I was searching for a method that return DeeplinkResult but not launching activities inside the method, so that the returned DeeplinkResult can be used for general purposes.

Example


val deeplinkResult = delegate.dispatchFrom(activity, intent) // This method returns result, but it is also launching activities internally
if (comeFromExternal) {
 startActivityWithProperTaskStack(deeplinkResult.intent)
} else {
 startActivity(deeplinkResult.intent)
}

Is there any workaround for such usecase please?

hashlin commented 3 years ago

https://github.com/airbnb/DeepLinkDispatch/pull/316 from version 5.4.0 and https://github.com/airbnb/DeepLinkDispatch/pull/318 from version 5.4.1 seems solves the question.

Thanks a lot. The library is amazing 🙇🏼

mikebgrep commented 2 years ago

@hashlin You can help me to set up in Java project I try but is not open the deep link from the annotation in the Activity