Skip to content

StylianosGakis/navigation-recents-url-sharing

Repository files navigation

Navigation Recents URL Sharing

GitHub license Maven Central

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.

Getting started

  1. Add the com.stylianosgakis.navigation.recents.url.sharing:navigation-recents-url-sharing:{VERSION_HERE} dependency.
  2. Use the onProvideAssistContent(outContent: AssistContent) function in your Activity, and use the library's fun 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

The latest version is Maven Central

Releases are hosted on Maven Central.

repositories {
  mavenCentral()
}

dependencies {
  implementation("com.stylianosgakis.navigation.recents.url.sharing:navigation-recents-url-sharing:{VERSION_HERE}")
}

Real world example

This library is currently used in the Hedvig app. The Hedvig app showing a deep link to

Future work

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages