permissions
Check access before a feature needs it, explain why it helps, and handle denial without trapping the user. Use the shared permissions API for camera, microphone, photos, location and notifications.
Declare permission reasons in configuration
import type { KuitoConfig } from 'kuito/config';
export default {
name: 'Reel',
ios: { bundleIdentifier: 'com.example.reel' },
android: { applicationId: 'com.example.reel' },
permissions: {
camera: 'Scan tickets at the door.',
location: 'Find screenings near you.',
notifications: true,
},
} satisfies KuitoConfig;Check access and offer Settings
import { app, permissions } from 'kuito';
const { status, canAskAgain } = await permissions.check('camera');
if (status === 'undetermined') await permissions.request('camera');
else if (status === 'denied' && !canAskAgain) await app.openSettings();Behavior and limits
check(name) reads without prompting; request(name) asks when the OS permits it. Results contain status and canAskAgain. Handle granted, limited, denied and undetermined separately. When canAskAgain is false, offer app.openSettings() as a user action instead of repeatedly requesting. Declare usage reasons before accessing protected APIs; iOS can terminate an app with a missing reason. locationAlways also needs location. Biometrics is a configuration declaration used by secureStore, not a name accepted by check/request.
Continue
Read Secure store for the related workflow. The API reference lists every method, option, event and return type.
Référence
Exports 5
Méthodes, constantes et types exposés par cet espace de noms natif.
PermissionNameWhat an app can ask for.typePermissionStatuslimited is access the user narrowed: a selection of photos (iOS 14+,
Android 14+).typePermissionResponseWhether the app holds a permission, and whether asking again can still show the system prompt.functioncheckThe current status, without prompting.functionrequestShows the system prompt when it can, and resolves with the user's answer.