cap-camera-permission
v0.0.4
Published
To check and request only the camera permission on a capacitor app. It's a subset of @capacitor/camera and does not require NSPhotoLibraryUsageDescription key.
Downloads
21
Maintainers
Readme
cap-camera-permission
To check and request only the camera permission on a capacitor app. It's a subset of @capacitor/camera and does not require NSPhotoLibraryUsageDescription key.
Use case: When you only care about camera and do not want to request for photo library permissions, for example, accessing camera feed to scan items without the need to save the video.
Install
npm install cap-camera-permission
npx cap sync
API
checkPermissions()
checkPermissions() => Promise<{ camera: PermissionState; }>
Check camera and photo album permissions
Returns: Promise<{ camera: any; }>
Since: 1.0.0
requestPermissions(...)
requestPermissions(permissions?: CameraPluginPermissions | undefined) => Promise<{ camera: PermissionState; }>
Request camera and photo album permissions
| Param | Type |
| ----------------- | --------------------------------------------------------------------------- |
| permissions
| CameraPluginPermissions |
Returns: Promise<{ camera: any; }>
Since: 1.0.0
Interfaces
CameraPluginPermissions
| Prop | Type |
| ----------------- | ----------------------- |
| permissions
| ['camera'] |
Type Aliases
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'