permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.

Home Page:https://github.com/permissions-dispatcher/PermissionsDispatcher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[KTX] Combine location permissions with other permissions

TurKurT656 opened this issue · comments

Overview

  • With the help of constructPermissionsRequest fun we can request multiple permissions at the same time (for example, Camera and Microphone), by passing multiple permissions to the function (vararg).
  • But location permissions have a different function for handling requests (constructLocationPermissionRequest). So how we can combine location permissions with other permissions at the same time?

Expected

  • Combine all permissions like:
    constructPermissionsRequest(CAMERA, LOCATION_FINE) { TODO() }

Actual

  • We have to launch location permission after camera granted:
    constructPermissionsRequest(CAMERA) { constructLocationPermissionRequest(LOCATION_FINE) { TODO() } }

Environment

  • Which library version are you using? 1.1.2
  • On which devices do you observe the issue? ALL

Hi, you can use constructPermissionsRequest along with location permission if you want to. constructLocationPermissionRequest is just a helper function to address with #646 without any additional effort.

Thanks