Rinku

Project Url: theolm/Rinku
Introduction: Deep Link Handling for Kotlin Multiplatform
More: Author   ReportBugs   OfficialWebsite   
Tags:

Maven Central Kotlin PRs Welcome GitHub License

Rinku is a lightweight Kotlin Multiplatform library designed to simplify deep link handling across iOS, Android, JVM desktop (macOS, Windows, and Linux), and Web (Kotlin/JS and Kotlin/Wasm browsers). By abstracting platform-specific details, Rinku enables developers to manage deep links in a unified manner, enhancing code reuse and maintaining consistency across platforms.

Core Features

  • Unified Deep Link Management: Architect your deep link logic once, and execute across iOS, Android, JVM desktop, and Web platforms.
  • Simplified Integration: Designed for rapid setup with minimal configuration requirements, ensuring a smooth start.
  • Universal Compatibility with Navigation Libraries: Rinku's architecture is designed for compatibility with any navigation library (Voyager, Decompose, custom solutions, etc.). It delegates the parsing and navigation logic to the application, permitting seamless integration and enhanced flexibility.

Prerequisites

  • Kotlin Multiplatform project setup
  • For Android: Minimum SDK version 23
  • For iOS: iOS 13.0 or later
  • Supported iOS architectures: iosArm64 and iosSimulatorArm64. Intel Mac simulators (iosX64) are no longer supported by either module.
  • For desktop: JVM 17 or later. See the desktop setup guide for URL schemes, single-instance delivery, and packaging.
  • For Web: Kotlin/JS or Kotlin/Wasm (wasmJs) in a browser. See the Web setup guide for initial URLs, browser history, Compose integration, and hosting.

The library is available via Maven Central

implementation("dev.theolm:rinku:<latest_version>")
implementation("dev.theolm:rinku-compose-ext:<latest_version>")

For iOS, Swift export, filters, mappers, and other platforms, see the full documentation.

Quick Start

1. Initialize on Android

Inside MainActivity.onCreate, call RinkuInit():

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        RinkuInit()
        setContent { App() }
    }
}

If you use Compose Multiplatform, wrap your root instead:

setContent {
    Rinku { App() }
}

2. Listen and navigate in common code

@Composable
fun RootApp() {
    var deepLink by remember { mutableStateOf<DeepLink?>(null) }
    DeepLinkListener { deepLink = it }
    MainScreen(deepLink)
}
Rinku.handleDeepLink("https://example.com/second/third?user={\"name\":\"Theo\"}")

// Access parsed components
deepLink?.host
deepLink?.pathSegments       // ["second", "third"]
deepLink?.parameters         // { "user" = "{\"name\":\"Theo\"}" }

For type-safe arguments, custom URL schemes, filters, and iOS setup, see the full documentation.

Samples

The samples/ directory contains runnable examples demonstrating integration with popular navigation libraries:

  • samples/common — Shared UI components and screen definitions used by both samples
  • samples/voyager — Voyager integration (shared module, Android app, iOS app, desktop app, JS/Wasm Web app)
  • samples/decompose — Decompose integration (shared module, Android app, desktop app, JS/Wasm Web app)

Documentation

You can find the full documentation here

For coding agents, llms.txt provides a concise overview and links to the Markdown documentation.

License

Rinku is released under the MIT License. See the LICENSE file for more details.

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools
AI Daily Digest