request

fun request(rationaleMessage: String? = null, settingsMessage: String? = null, onGranted: (GrantStatus) -> Unit)

If a request is already in-flight, the call is logged and ignored.

This function orchestrates the entire flow:

  1. Check current status

  2. If NOT_DETERMINED → Request immediately

  3. If DENIED → Show rationale dialog

  4. If DENIED_ALWAYS → Show settings guide

  5. If GRANTED → Execute callback

Parameters

rationaleMessage

Custom message for rationale dialog (optional)

settingsMessage

Custom message for settings dialog (optional)

onGranted

Callback executed ONLY when grant is GRANTED or PARTIAL_GRANTED. Callback is cleared after execution to prevent memory leaks.