{"repo":"deva666/Peko","free":true,"listed":false,"github":"https://github.com/deva666/Peko","clone":"git clone https://github.com/deva666/Peko.git","description":"Android Library for requesting Permissions with Kotlin Flow","language":"Kotlin","stars":152,"topics":["android","android-library","kotlin","kotlin-coroutines","android-permissions","coroutines","flow","streams"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"PEKO PE rmissions with KO tlin --- Android Permissions with Kotlin Coroutines and Flow API No more callbacks, listeners or verbose code for requesting Android permissions. Get Permission Request Result asynchronously with one function call. Context or Activity not needed for requests, request permissions from your View Model or Presenter. Built with Kotlin Coroutines and Flow . Thanks to the supporters Sponsored by CloudBit Installation Hosted on Maven Central Example First initialize the PermissionRequester with Application Context. This enables all requests to be made without a Context or Activity . If you pass an Activity as Context , IllegalStateException is raised. Get the instance of PermissionRequester interface. Request one or more permissions. For each permission receive PermissionResult as async Flow stream of data. Need to check only if permissions are granted? Let's skip the horrible Android API. No coroutine required. Or are any of the requested granted? Why Flows? Requesting multiple permissions in a single request represents a data stream of PermissionsResult objects. Flow fits here perfectly. Each permission requested is either granted or denied, with Flow we can operate on each emitted result item and inspect it individually, that is check if it is Granted, Denied or Needs Rationale. Flows are async and require a coroutine to collect so this is not a huge update from Peko version 2. Also, they are now part of Kotlin Coroutines library, so no new dependencies ","default_branch":null,"files":null,"tree":[],"storefront":"/r/deva666","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/deva666/Peko/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}