Getting Started

Getting Started

Install

commonMain.dependencies {
    implementation("io.github.androidpoet:quick-actions:0.2.0")
    implementation("io.github.androidpoet:quick-actions-compose:0.2.0")   // Compose Multiplatform helpers
}

Publish and receive

@Composable
fun App() {
    val quickActions = rememberQuickActionsManager()
 
    PublishQuickActions(
        listOf(
            QuickAction("start-timer", "Start timer", subtitle = "25 minutes", icon = "timer", data = mapOf("route" to "timer")),
            QuickAction("log-water", "Log water", icon = "drop.fill", data = mapOf("route" to "water")),
        ),
        quickActions,
    )
 
    OnQuickActionLaunch(quickActions) { launch ->
        navigate(launch.action.data["route"])
        quickActions.reportUsed(launch.action.id)
    }
}

Keep both helpers at the root of the UI: publishing an equal list is free, and each launch reaches one collector.

Icons

icon is an SF Symbol name on iOS. On Android, map it to a drawable once at start-up; skip this and every action shows the app icon.

QuickActions.androidConfig = AndroidQuickActionsConfig(
    iconResolver = { key -> when (key) { "timer" -> R.drawable.ic_timer; "drop.fill" -> R.drawable.ic_drop; else -> 0 } },
)

Platform setup

None. iOS hooks delivery in when the binary loads (details). Android is wired by rememberQuickActionsManager(); without Compose call QuickActions.attach(activity) once in onCreate (details).