Runtime permissions
Prompt for camera, location, or contacts before using a gated feature.
Request a permission
Show the native OS permission prompt for one capability. Call it right before you use the feature. permission is one of "camera", "contacts", "record audio", "write to storage", or "location".
The resolved promise tells you the request was sent, not whether the user said yes — read the decision from the next deviceInfo event.
There is no permission-result event. Read the grant/deny outcome from the next deviceInfo event.
Gate a feature behind a permission
Check the current status, prompt only if it isn't granted, then wait for the deviceInfo event to confirm before using the feature. Get the current snapshot from bdk.ready() or bdk.getDeviceInfo(); the deviceInfo event delivers the updated one after the user answers.
Status field names don't match the PermissionName strings:
"camera"→cameraPermissionStatus"contacts"→contactsPermissionStatus"record audio"→audiorecordPermissionStatus"write to storage"→externalstoragePermissionStatus"location"→locationPermissionStatus