Camera

The Camera API allows the user to either capture an image with the camera or choose from the existing.


Usage

transition({
	type: MOBILE_CAMERA,
	quality: 90,
	allowEditing: true,
	isBase64: false
})


Transition

ID Next States Description
MOBILE_CAMERA MOBILE_BEFORE_NETWORKSTATE, MOBILE_BEFORE_APPSTATE, MOBILE_ON_LOADED This transition allows to either click a photo with the camera or choose from the existing one from the photo album.


Properties

name type default description
quality number The quality of the resulting image that can range between 0-100
allowEditing boolean false Whether to allow the user to crop or edit the image
isBase64 boolean How the data should be returned. Curretly, only ‘Base64’, or ‘Uri’ is supported


Capacitor configuration

with npm

npm install @capacitor/camera

iOS

//iOS requires the following usage description be added and filled out for your app in Info.plist: NSCameraUsageDescription (Privacy - Camera Usage Description) NSPhotoLibraryAddUsageDescription (Privacy - Photo Library Additions Usage Description) NSPhotoLibraryUsageDescription (Privacy - Photo Library Usage Description)

Android

//This API requires the following permissions be added to your AndroidManifest.xml: ```