request Permissions Safely

fun requestPermissionsSafely(    permissions: Array<String>,     onPermissionGranted: () -> Unit? = null,     onPermissionNotGranted: () -> Unit? = null)

Method to request permission to user

Parameters

permissions

list of permissions to request

onPermissionGranted

action to do when permission granted

onPermissionNotGranted

action to do when permission not granted

Sources

Link copied to clipboard