permissionsBuilder .sendSuspend() not completing first time
See original GitHub issueDescription
Using version 3.2.0, after given Location Permissions, sendSuspend()
doesn’t return, in other words, my app freezes the UI (it doesn’t get rendered because it needs location permission and since sendSuspend()
doesn’t complete I can’t query result.allGranted()
and proceed with logic.
If I navigate back and then forward it works (the permission wore granted and no pop-up is shown, I can query result.allGranted()
happily and carry on).
If I downgrade to 3.1.3 it works as expected.
KPermissions version: 3.2.0
API level: SDK 30, Google Pixel 3a Android 11
How to reproduce it: Clear app cache and run it so that permissions are prompt again.
Sample code:
lifecycleScope.launchWhenResumed {
val result =
permissionsBuilder(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION).build().sendSuspend()
if (result.allGranted()) { ... }
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:31 (16 by maintainers)
Top Results From Across the Web
How to properly pause app until permission request is finished?
Put the code inside your //More UI preparation stuff to a new method. After the permissions, say ' init() ' private void init(){...
Read more >Send Emails with SendGrid API using Micronaut with Kotlin ...
It suspends the coroutine for a specific time. Suspending a coroutine does not block the underlying thread, but allows other coroutines to run ......
Read more >Request app permissions - Android Developers
In certain situations, the permission might be denied automatically, without the user taking any action. (A permission might be granted automatically as well.) ......
Read more >Create an IAM user and assume a role with Amazon STS ...
The following code examples show how to: Create a user who has no permissions. Create a role that grants permission to list Amazon...
Read more >Apache Kafka Reference Guide - Quarkus
SmallRye Reactive Messaging processes records asynchronously, so offsets may be committed for records that have been polled but not yet processed. In case...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s fixed!
@GuilhE Can you try the version 3.2.1 and check that the bug is fixed?