PermissionChecker

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun checkAudioPermissions(view: View, onPermissionResult: (Map<String, Boolean>) -> Unit)

Requests the correct audio media permissions based on the device's API level.

Link copied to clipboard
fun checkAudioRecordPermissions(view: View, onPermissionDenied: () -> Unit = { }, onPermissionGranted: () -> Unit = { })
Link copied to clipboard
fun checkCameraPermissions(view: View, onPermissionDenied: () -> Unit = { }, onPermissionGranted: () -> Unit)
Link copied to clipboard
fun checkFilesPermissions(view: View, onPermissionResult: (Map<String, Boolean>) -> Unit)

Requests the correct files permissions (image/video/audio) based on the device's API level.

Link copied to clipboard
fun checkVisualMediaPermissions(view: View, onPermissionResult: (Map<String, Boolean>) -> Unit)

Requests the correct visual media permissions (image/video) based on the device's API level.

Link copied to clipboard
fun checkWriteStoragePermissions(view: View, onPermissionDenied: () -> Unit = { }, onPermissionGranted: () -> Unit)

Checks is Manifest.permission.WRITE_EXTERNAL_STORAGE is needed an requests if necessary. Permission will be requested on versions below Build.VERSION_CODES.Q or if legacy external storage is enabled. Simply runs onPermissionGranted if the permission is not needed.

Link copied to clipboard
Link copied to clipboard

Check if Camera Permission needs to be requested to the user