requestOverlayPermission

fun requestOverlayPermission(onGranted: () -> Unit, onDenied: () -> Unit)

Requests overlay permission for the application. On Android M (API 23) and above, this method initiates an intent to the system settings screen where the user can grant the overlay permission.

Note: Ensure to add the following permission in the app's manifest file:

Parameters

onGranted

Callback executed when the permission is granted.

onDenied

Callback executed when the permission is denied.