GrantStore

interface GrantStore

An abstraction for tracking the history of permission requests.

Grant uses an in-memory storage strategy by default, which is the industry standard for mobile permission libraries. This ensures that the OS native status remains the source of truth while providing enough session context to differentiate between "Never Asked" and "Denied Always" on Android.

Inheritors

Functions

Link copied to clipboard
abstract fun clear()

Clears all session-cached data.

abstract fun clear(grant: AppGrant)

Clears session-cached data for a specific permission.

Link copied to clipboard
abstract fun getStatus(grant: AppGrant): GrantStatus?

Retrieves the session-cached status for a permission.

Link copied to clipboard

Extension for getting the status of any GrantPermission.

Link copied to clipboard
abstract fun isRawPermissionRequested(identifier: String): Boolean

Checks if a custom RawPermission has been requested.

Link copied to clipboard
abstract fun isRequestedBefore(grant: AppGrant): Boolean

Checks if a permission has been requested during this app session or install.

Link copied to clipboard

Extension for checking if any GrantPermission has been requested before.

Link copied to clipboard
abstract fun markRawPermissionRequested(identifier: String)

Marks a custom RawPermission as having been requested.

Link copied to clipboard
abstract fun setRequested(grant: AppGrant)

Marks a permission as having been requested.

Link copied to clipboard

Extension for marking any GrantPermission as requested.

Link copied to clipboard
abstract fun setStatus(grant: AppGrant, status: GrantStatus)

Caches the status for a permission in the current session.