Bug Description
After implementing a camera permission request via Grant, I noticed that the first request is swallowed when invoked.
Expected Behavior
I would expect that the rationale dialog shows up when requesting permission.
Actual Behavior
Nothing happens.
Steps to Reproduce
Here is a minimal reproduction project. I am personally using Compose Multiplatform, but it's reproducible in Android-only.
grant-permission-repro.zip
- Import the minimal project.
- Start the app.
- When started, deny the camera permission.
- Click the button again to see the rationale.
- Cancel the rationale.
- Restart the app.
- When the app starts, press the button to request permission.
- See, nothing happens.
- Press again to see the rationale dialog.
Video
Sorry for the washed colors, I forgot to disable HDR. But I am sure you get the idea. This is the restart of the app. The first button click does nothing, but the state is updated. Only the second click brings up the dialog.
https://github.com/user-attachments/assets/93f92360-2fb7-45f4-adb7-1bc85d3f1450
Environment
Grant Version:
2.2.1
Platform:
Platform Details:
- Android API Level: 37
- iOS Version: /
- Device/Emulator: Android Emulator
Dependencies:
- Kotlin: 2.4.0
- Compose: 2.4.0
- Koin (if applicable): 4.2.2
Workaround
I thought about checking the new state after the first request and checking that to immediately start a second request, but this is rather ugly.
Checklist
Bug Description
After implementing a camera permission request via Grant, I noticed that the first request is swallowed when invoked.
Expected Behavior
I would expect that the rationale dialog shows up when requesting permission.
Actual Behavior
Nothing happens.
Steps to Reproduce
Here is a minimal reproduction project. I am personally using Compose Multiplatform, but it's reproducible in Android-only.
grant-permission-repro.zip
Video
Sorry for the washed colors, I forgot to disable HDR. But I am sure you get the idea. This is the restart of the app. The first button click does nothing, but the state is updated. Only the second click brings up the dialog.
https://github.com/user-attachments/assets/93f92360-2fb7-45f4-adb7-1bc85d3f1450
Environment
Grant Version:
2.2.1
Platform:
Platform Details:
Dependencies:
Workaround
I thought about checking the new state after the first request and checking that to immediately start a second request, but this is rather ugly.
Checklist