{"id":13611320,"url":"https://github.com/robertlevonyan/permissions-flow","last_synced_at":"2025-03-16T20:30:28.955Z","repository":{"id":56443623,"uuid":"259236098","full_name":"robertlevonyan/permissions-flow","owner":"robertlevonyan","description":"A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.","archived":false,"fork":false,"pushed_at":"2023-10-29T14:34:34.000Z","size":288,"stargazers_count":86,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T12:45:58.190Z","etag":null,"topics":["android","android-app","android-application","android-architecture","android-development","android-library","android-sdk","kotlin","kotlin-android","kotlin-coroutines","kotlin-extensions","kotlin-library","library","permissions"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertlevonyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-04-27T07:17:18.000Z","updated_at":"2024-03-18T08:15:41.000Z","dependencies_parsed_at":"2022-08-15T18:50:34.470Z","dependency_job_id":"9773147d-fc45-43d4-907b-552a4459710f","html_url":"https://github.com/robertlevonyan/permissions-flow","commit_stats":null,"previous_names":["innfinity-am/permissionsflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fpermissions-flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fpermissions-flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fpermissions-flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fpermissions-flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertlevonyan","download_url":"https://codeload.github.com/robertlevonyan/permissions-flow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826798,"owners_count":20354221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-application","android-architecture","android-development","android-library","android-sdk","kotlin","kotlin-android","kotlin-coroutines","kotlin-extensions","kotlin-library","library","permissions"],"created_at":"2024-08-01T19:01:54.130Z","updated_at":"2025-03-16T20:30:28.949Z","avatar_url":"https://github.com/robertlevonyan.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Permissions Flow\n#### Versions\n|PermissionsFlow|permission-compose|\n| --- | --- |\n|![Maven Central Version](https://img.shields.io/maven-central/v/com.robertlevonyan.components/PermissionsFlow)|![Maven Central Version](https://img.shields.io/maven-central/v/com.robertlevonyan.components/permission-compose)|\n\n\nA simple library to make it easy requesting permissions in Android using Kotlin Coroutines.\n\n## Setup\n\nAdd following line of code to your project level gradle file\n\n```kotlin\n  repositories {\n    mavenCentral()\n  }\n```\n\n#### Gradle:\n\nAdd following line of code to your module (app) level gradle file:\n\n```groovy\n    implementation 'com.robertlevonyan.components:PermissionsFlow:\u003cLATEST-VERSION\u003e'\n```\n\n#### Kotlin:\n\n```kotlin\n    implementation(\"com.robertlevonyan.components:PermissionsFlow:$LATEST_VERSION\")\n```\n\n#### Maven:\n\n```xml\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.robertlevonyan.components\u003c/groupId\u003e\n    \u003cartifactId\u003ePermissionsFlow\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST-VERSION\u003c/version\u003e\n    \u003ctype\u003epom\u003c/type\u003e\n  \u003c/dependency\u003e\n```\n\n### For Jetpack Compose\n```kotlin\n    implementation(\"com.robertlevonyan.components:permission-compose:$LATEST_VERSION\")\n```\n\n### Usage:\n\nPermission flow offers 2 simple extension functions - both for for activities/fragments:\n\n```kotlin\n    requestPermissions(vararg permissionsToRequest: String)\n    requestEachPermissions(vararg permissionsToRequest: String)\n```\n\nBoth functions do request all permissions passed to them - the first one emits a list of `Permissions`, the second one flattens the permissions.\n\nHere's a full code example like it would look like in an activity:\n\n```kotlin\noverride fun onCreate(savedInstanceState: Bundle?) {\n \n    CoroutineScope(Dispatchers.Main).launch {\n        // just call requestPermission and pass in all required permissions\n        requestPermissions(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n            .collect { permissions -\u003e\n                // here you get the result of the requests, permissions holds a list of Permission requests and you can check if all of them have been granted:\n                val allGranted = permissions.find { !it.isGranted } == null\n                // or iterate over the permissions and check them one by one\n                permissions.forEach { \n                \tval granted = it.isGranted\n                \t// ...\n                }\n            }\n\t}\n}\n```\n\n### For Jetpack Compose\n```kotlin\n    @Composable\n    fun AppContent() {\n        val permissionState = rememberPermissionState(listOf(Manifest.permission.CAMERA)) { granted -\u003e\n            // do something awesome\n        }\n    \n        // ...\n\n        permissionState.launchPermissionRequest()\n    }\n```\n\n## That's it!\n\nWith only few simple steps you can request permissions without splitting your code or overriding functions.\n\n## Versions\n#### 1.2.8\nVersion and dependency bump\n\n#### 1.2.1 - 1.2.3\n\nUpdate to Java 11,\nSDK 31 ready,\nMinor updates\n\n### 1.2.0\n\nMigration to mavenCentral\n\n#### 1.1.0\n\nExtensions for Fragment and Activity added\n\n### 1.0.0\n\nFirst version of library\n\n## Contact\n\n- **Email**: me@robertlevonyan.com\n- **Website**: https://robertlevonyan.com/\n- **Medium**: https://medium.com/@RobertLevonyan\n- **Twitter**: https://twitter.com/@RobertLevonyan\n- **Google Play**: https://play.google.com/store/apps/dev?id=5477562049350283357\n\n## Licence\n\n```\n    Permissions Flow©\n    Copyright 2020 Robert Levonyan\n    Url: https://github.com/innfinity-am/PermissionsFlow\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertlevonyan%2Fpermissions-flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertlevonyan%2Fpermissions-flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertlevonyan%2Fpermissions-flow/lists"}