Core permission management functions providing cross-platform access to device permissions with unified API and deprecation warnings.
Checks current permission status without prompting the user. Returns current permission state for all specified permission types.
/**
* Get current permission status without prompting user
* @param types - Variable number of permission types to check
* @returns Promise resolving to permission response with status and details
* @deprecated Package deprecated - use individual Expo modules instead
*/
function getAsync(...types: PermissionType[]): Promise<PermissionResponse>;Usage Examples:
import { getAsync, CAMERA, LOCATION_FOREGROUND } from "expo-permissions";
// Check single permission
const cameraStatus = await getAsync(CAMERA);
console.log("Camera granted:", cameraStatus.granted);
// Check multiple permissions
const multipleStatus = await getAsync(CAMERA, LOCATION_FOREGROUND);
console.log("All granted:", multipleStatus.granted);
console.log("Individual statuses:", multipleStatus.permissions);Requests permissions from the user, potentially showing system permission prompts. May trigger native permission dialogs on first request.
/**
* Request permissions from user (may show system prompt)
* @param types - Variable number of permission types to request
* @returns Promise resolving to permission response with status and details
* @deprecated Package deprecated - use individual Expo modules instead
*/
function askAsync(...types: PermissionType[]): Promise<PermissionResponse>;Usage Examples:
import { askAsync, CAMERA, MEDIA_LIBRARY, LOCATION_FOREGROUND } from "expo-permissions";
// Request single permission
const cameraPermission = await askAsync(CAMERA);
if (cameraPermission.granted) {
console.log("Camera access granted");
} else {
console.log("Camera access denied");
}
// Request multiple permissions
const permissions = await askAsync(CAMERA, MEDIA_LIBRARY, LOCATION_FOREGROUND);
console.log("Overall status:", permissions.status);
console.log("Can ask again:", permissions.canAskAgain);
// Check individual permission details
Object.entries(permissions.permissions).forEach(([type, info]) => {
console.log(`${type}: ${info.status}`);
if (info.scope) {
console.log(` Scope: ${info.scope}`);
}
if (info.accessPrivileges) {
console.log(` Access: ${info.accessPrivileges}`);
}
});Both getAsync and askAsync return a PermissionResponse object with coalesced status and individual permission details:
interface PermissionResponse {
/** Coalesced status of all requested permissions (UNDETERMINED > DENIED > GRANTED) */
status: PermissionStatus;
/** Earliest expiration time among all permissions, or 'never' */
expires: PermissionExpiration;
/** True only if ALL requested permissions are granted */
granted: boolean;
/** True only if ALL requested permissions can be asked again */
canAskAgain: boolean;
/** Map of individual permission details by permission type */
permissions: PermissionMap;
}accessPrivileges field with values 'all', 'limited', or 'none'android.accuracy field with 'fine', 'coarse', or 'none'Common Errors:
// Unknown permission type
try {
await getAsync('invalidPermission' as PermissionType);
} catch (error) {
// E_PERMISSIONS_UNKNOWN with module suggestion
console.log(error.message); // "Unknown permission type, please install expo-camera"
}
// Empty permission array
try {
await askAsync();
} catch (error) {
// "At least one permission type must be specified"
}When multiple permissions are requested, the library uses coalescing logic to determine overall status:
true only if ALL permissions are grantedtrue only if ALL permissions can be asked again// Example: Mixed permission states
const result = await askAsync(CAMERA, LOCATION_FOREGROUND);
// If camera is GRANTED and location is DENIED:
// result.status = DENIED (heaviest status)
// result.granted = false (not all granted)
// result.canAskAgain = depends on both permissions