File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 77
88### Android Permissions with Kotlin Coroutines and Flow API
99
10- No more callbacks, builders, listeners or verbose code for requesting Android permissions.
11- Get Permission Request Result with one function call.
10+ No more callbacks, listeners or verbose code for requesting Android permissions.
11+ Get Permission Request Result asynchronously with one function call.
12+ ` Context ` or ` Activity ` not needed for requests, request permissions from your View Model or Presenter.
1213Built with [ Kotlin Coroutines] ( https://github.com/Kotlin/kotlinx.coroutines )
1314and [ Flow] ( https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/ ) .
1415***
@@ -67,7 +68,7 @@ val granted: Boolean = requester.areGranted(Manifest.permission.CAMERA, Manifest
6768
6869### Why Flows?
6970
70- Requesting multiple permissions in a single go represents a data stream of ` PermissionsResult ` objects. ` Flow ` fits here
71+ Requesting multiple permissions in a single request represents a data stream of ` PermissionsResult ` objects. ` Flow ` fits here
7172perfectly. Each permission requested is either granted or denied, with ` Flow ` we can operate on each emitted result item
7273and inspect it individually, that is check if it is Granted, Denied or Needs Rationale. Flows are async and require a
7374coroutine to collect so this is not a huge update from Peko version 2. Also, they are now part of Kotlin Coroutines
You can’t perform that action at this time.
0 commit comments