Camera Actions
os.capturePhoto(options?: PhotoCameraOptions): Promise<Photo>
Opens the photo camera for the user to take a single photo. Returns a promise that resolves with the taken photo. Triggers the @onPhotoCameraOpened
shout once opened.
While open, each time the user takes a photo the system will send a @onPhotoCaptured
shout. Optionally accepts which camera to use for scanning. (front/back)
The first parameter is optional and is a PhotoCameraOptions and is the options that should be used for the photo camera.
Examples
const photo = await os.capturePhoto();
await os.capturePhoto({
cameraType: "front"
});
await os.capturePhoto({
skipConfirm: true
});
await os.capturePhoto({
takePhotoAfterSeconds: 3
});
os.closePhotoCamera(): Promise<void>
Closes the photo camera. Returns a promise that resolves once the camera has been closed. Triggers the @onPhotoCameraClosed
shout once closed.
Examples
await os.closePhotoCamera();
os.openPhotoCamera(options?: PhotoCameraOptions): Promise<void>
Opens the photo camera. Returns a promise that resolves once the camera has been opened. Triggers the @onPhotoCameraOpened
shout once opened.
While open, each time the user takes a photo the system will send a @onPhotoCaptured
shout. Optionally accepts which camera to use for scanning. (front/back)
The first parameter is optional and is a PhotoCameraOptions and is the options that should be used for the photo camera.
Examples
await os.openPhotoCamera();
await os.openPhotoCamera({
cameraType: "front"
});