
Production-ready permission manager eliminating lifecycle boilerplate and fragments; automatic rationale/settings dialogs, service checks for GPS/Bluetooth, dead-click and gallery permission edge-case fixes, thread-safe API.
Production-ready, type-safe permission handling for Kotlin Multiplatform — handling the complex edge cases of Android and iOS flows.
Grant is not just another permission library. It is a production-hardened engine designed to handle complex edge cases that lead to crashes and hangs in other solutions. Built for professionals who demand absolute reliability.
Info.plist keys before requesting, preventing the dreaded SIGABRT production crashes.RawPermission to support new OS versions (Android 15+, iOS 18+) instantly without library updates.class CameraViewModel(private val grantManager: GrantManager) : ViewModel() {
// 💡 Works in pure common code!
val cameraGrant = GrantHandler(
grantManager = grantManager,
grant = AppGrant.CAMERA,
scope = viewModelScope
)
fun capturePhoto() {
cameraGrant.request {
// ✅ Only runs when permission is FULLY granted
cameraEngine.startCapture()
}
}
}@Composable
fun CameraScreen(viewModel: CameraViewModel) {
// 💡 Handles Rationale, Denied, and Settings dialogs automatically
GrantDialog(handler = viewModel.cameraGrant)
IconButton(onClick = { viewModel.capturePhoto() }) {
Icon(Icons.Default.Camera, contentDescription = "Capture")
}
}Most KMP permission libraries are simple wrappers around native APIs. Grant is an Architectural Solution.
| Feature | Grant | moko-permissions | accompanist-permissions |
|---|---|---|---|
| No Lifecycle Binding | ✅ | ❌ (needs BindEffect) | ❌ (needs Activity) |
| ViewModel Support | Full | Partial | ❌ |
| iOS Crash Prevention | ✅ | ❌ | ❌ |
| Android Deadlock Fix | ✅ | ❌ | ❌ |
| Process Death Recovery | Native | ❌ | Manual |
| Service Checks (GPS/BT) | ✅ | ❌ | ❌ |
| Android 14 Partial Access | ✅ | Partial | ✅ |
| iOS Deadlock Fix | ✅ | ❌ | N/A |
| Custom Permissions | ✅ | Limited | Limited |
| Permission | Android | iOS | Production Notes |
|---|---|---|---|
| Camera | ✅ | ✅ | iOS Main-thread safe + Deadlock fix |
| Gallery | ✅ | ✅ | Full Android 14+ Partial Access support |
| Location | ✅ | ✅ | Intelligent GPS service check included |
| Notifications | ✅ | ✅ | Handles Android 13+ and legacy flows |
| Bluetooth | ✅ | ✅ | Service status check + Scan/Adv support |
| Contacts | ✅ | ✅ | Support for read-only vs full access |
| Calendar | ✅ | ✅ | iOS 17+ Privacy Manifest compliant |
| Motion | ✅ | ✅ | Simulator-ready (returns mock on Sim) |
Add the ultimate permission engine to your commonMain:
// shared/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("dev.brewkits:grant-core:1.2.1")
implementation("dev.brewkits:grant-compose:1.2.1") // Optional UI pack
}
}
}[!IMPORTANT] For projects targeting Web (JS) or Desktop (JVM), please use an intermediate
mobileMainsource set. Read the Guide.
We are on a mission to make permissions a "solved problem" for KMP. Join us!
./gradlew :grant-core:allTests to ensure stability.Grant is licensed under the Apache License 2.0. See LICENSE for details.
Production-ready, type-safe permission handling for Kotlin Multiplatform — handling the complex edge cases of Android and iOS flows.
Grant is not just another permission library. It is a production-hardened engine designed to handle complex edge cases that lead to crashes and hangs in other solutions. Built for professionals who demand absolute reliability.
Info.plist keys before requesting, preventing the dreaded SIGABRT production crashes.RawPermission to support new OS versions (Android 15+, iOS 18+) instantly without library updates.class CameraViewModel(private val grantManager: GrantManager) : ViewModel() {
// 💡 Works in pure common code!
val cameraGrant = GrantHandler(
grantManager = grantManager,
grant = AppGrant.CAMERA,
scope = viewModelScope
)
fun capturePhoto() {
cameraGrant.request {
// ✅ Only runs when permission is FULLY granted
cameraEngine.startCapture()
}
}
}@Composable
fun CameraScreen(viewModel: CameraViewModel) {
// 💡 Handles Rationale, Denied, and Settings dialogs automatically
GrantDialog(handler = viewModel.cameraGrant)
IconButton(onClick = { viewModel.capturePhoto() }) {
Icon(Icons.Default.Camera, contentDescription = "Capture")
}
}Most KMP permission libraries are simple wrappers around native APIs. Grant is an Architectural Solution.
| Feature | Grant | moko-permissions | accompanist-permissions |
|---|---|---|---|
| No Lifecycle Binding | ✅ | ❌ (needs BindEffect) | ❌ (needs Activity) |
| ViewModel Support | Full | Partial | ❌ |
| iOS Crash Prevention | ✅ | ❌ | ❌ |
| Android Deadlock Fix | ✅ | ❌ | ❌ |
| Process Death Recovery | Native | ❌ | Manual |
| Service Checks (GPS/BT) | ✅ | ❌ | ❌ |
| Android 14 Partial Access | ✅ | Partial | ✅ |
| iOS Deadlock Fix | ✅ | ❌ | N/A |
| Custom Permissions | ✅ | Limited | Limited |
| Permission | Android | iOS | Production Notes |
|---|---|---|---|
| Camera | ✅ | ✅ | iOS Main-thread safe + Deadlock fix |
| Gallery | ✅ | ✅ | Full Android 14+ Partial Access support |
| Location | ✅ | ✅ | Intelligent GPS service check included |
| Notifications | ✅ | ✅ | Handles Android 13+ and legacy flows |
| Bluetooth | ✅ | ✅ | Service status check + Scan/Adv support |
| Contacts | ✅ | ✅ | Support for read-only vs full access |
| Calendar | ✅ | ✅ | iOS 17+ Privacy Manifest compliant |
| Motion | ✅ | ✅ | Simulator-ready (returns mock on Sim) |
Add the ultimate permission engine to your commonMain:
// shared/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("dev.brewkits:grant-core:1.2.1")
implementation("dev.brewkits:grant-compose:1.2.1") // Optional UI pack
}
}
}[!IMPORTANT] For projects targeting Web (JS) or Desktop (JVM), please use an intermediate
mobileMainsource set. Read the Guide.
We are on a mission to make permissions a "solved problem" for KMP. Join us!
./gradlew :grant-core:allTests to ensure stability.Grant is licensed under the Apache License 2.0. See LICENSE for details.