This library provides easy integration with the Android OS "Recents" screen by automatically figuring out if you are in a screen which has a deep link, and provides that deep link as the copyable/shareable link using the URL Sharing feature.
It relies on you using androidx.navigation and using that library's integration with deep links to handle all of your deep links.
This article covers how this library came to be, and some of the implementation details.
- Add the
com.stylianosgakis.navigation.recents.url.sharing:navigation-recents-url-sharing:{VERSION_HERE}
dependency. - Use the
onProvideAssistContent(outContent: AssistContent)
function in your Activity, and use the library'sfun NavController.provideAssistContent(outContent: AssistContent, allDeepLinkUriPatterns: List<String>)
function. In your Activity:
override fun onProvideAssistContent(outContent: AssistContent) {
super.onProvideAssistContent(outContent)
navController?.provideAssistContent(outContent, listOfAllDeepLinkUriPatterns)
}
You can take a look at the sample app for a full example.
Releases are hosted on Maven Central.
repositories {
mavenCentral()
}
dependencies {
implementation("com.stylianosgakis.navigation.recents.url.sharing:navigation-recents-url-sharing:{VERSION_HERE}")
}
This library is currently used in the Hedvig app.
When androidx.navigation
properly provides a KMP version, this library will try to provide integration with that
too if the deep link integration is ported to multiplatform too.