Companion

object Companion

Properties

Link copied to clipboard
const val PERMISSIONS_REQUEST_CODE: Int = 554

Functions

Link copied to clipboard

Check if all required permissions have been granted by the user

Link copied to clipboard
fun definePermissions(permissionsToRequest: LinkedHashMap<String, Boolean>)

Change the permissions to request

Link copied to clipboard
fun isPermissionRequired(permissionName: String): Boolean

Check if permission is required

Link copied to clipboard
fun requestPermission(activity: Activity, permissionToRequest: Pair<String, Boolean>): Boolean

Simply call this method to request one permission

Link copied to clipboard

Simply call this method to request all defined permissions (by default, the permissions defined are those for the mSDK)

fun requestPermissions(activity: Activity, permissionsToRequest: LinkedHashMap<String, Boolean>): Boolean

Simply call this method to request the permissions passed to the method

Check that a permission has been denied for the first time (never ask again is not checked)

Link copied to clipboard
fun showPermissionExplainedDialog(activity: Activity, permissionName: String, permissionExplanation: String = getExplanationMessageForPermission(activity, permissionName))

Shows an alert dialog that explains the purpose of the declined permission with a button to accept the permission, and a button to quit the application if the permission is required (otherwise a button to continue)

Link copied to clipboard
fun showRequiredPermissionExplainedDialog(activity: Activity, explanationMessage: String = activity.getString( R.string.permissions_request_message_general ))

Shows a general alert dialog (by default, it explains the purpose of all permissions for the mSDK)

fun showRequiredPermissionIsFullyDeniedDialog(activity: Activity, title: String = activity.getString( R.string.title_permission_declined ), explanation: String = activity.getString(R.string.message_permission_fully_declined))

Shows an alert dialog to accept permissions that have been declined with "never ask again" checked