checkPermission

Checks the permission based on the provided settings.

This function evaluates permission settings for different media types and returns the appropriate permission status. It supports various permission levels including allow, approval, and disallow.

Features:

  • Multi-media permission checking

  • Configurable permission levels

  • Type-specific permission evaluation

  • Status code return system

  • Error handling

Parameters:

  • options Configuration options containing permission settings

Returns:

  • Result<Int> representing the permission status:

  • 0: Permission is allowed

  • 1: Permission requires approval

  • 2: Permission is disallowed or invalid type

Example Usage:

val options = CheckPermissionOptions(
permissionType = "audioSetting",
audioSetting = "allow",
videoSetting = "approval",
screenshareSetting = "approval",
chatSetting = "allow"
)

val result = checkPermission(options)
result.onSuccess { status ->
when (status) {
}
}
result.onFailure { error ->
Logger.e("CheckPermission", "Error checking permission: ${error.message}")
}