check

fun check(context: Context, permission: String, rationale: String, handler: PermissionHandler)

Check/Request a permission and call the callback methods of permission handler accordingly.

Parameters

context

the android context.

permission

the permission to be requested.

rationale

Explanation to be shown to user if s/he has denied permission earlier. If this parameter is null, permissions will be requested without showing the rationale dialog.

handler

The permission handler object for handling callbacks of various user actions such as permission granted, permission denied, etc.


fun check(context: Context, permission: String, rationaleId: Int, handler: PermissionHandler)

Check/Request a permission and call the callback methods of permission handler accordingly.

Parameters

context

the android context.

permission

the permission to be requested.

rationaleId

The string resource id of the explanation to be shown to user if s/he has denied permission earlier. If resource is not found, permissions will be requested without showing the rationale dialog.

handler

The permission handler object for handling callbacks of various user actions such as permission granted, permission denied, etc.


fun check(context: Context, permissions: Array<String>, rationale: String, options: Permissions.Options, handler: PermissionHandler)

Check/Request permissions and call the callback methods of permission handler accordingly.

Parameters

context

Android context.

permissions

The array of one or more permission(s) to request.

rationale

Explanation to be shown to user if s/he has denied permission earlier. If this parameter is null, permissions will be requested without showing the rationale dialog.

options

The options for handling permissions.

handler

The permission handler object for handling callbacks of various user actions such as permission granted, permission denied, etc.


fun check(context: Context, permissions: Array<String>, rationaleId: Int, options: Permissions.Options, handler: PermissionHandler)

Check/Request permissions and call the callback methods of permission handler accordingly.

Parameters

context

Android context.

permissions

The array of one or more permission(s) to request.

rationaleId

The string resource id of the explanation to be shown to user if s/he has denied permission earlier. If resource is not found, permissions will be requested without showing the rationale dialog.

options

The options for handling permissions.

handler

The permission handler object for handling callbacks of various user actions such as permission granted, permission denied, etc.