Skip to main content

bn.chooseImage

chooseImage(options): Promise<ChooseImageResponse>

description Selects an image from the local album or takes a photo with the camera.

example

const res = await bn.chooseImage({ count: 9, sizeType: ['original'], sourceType: ['album'],})console.log(res.tempFilePaths, res.tempFiles)

Parameters

NameType
optionsChooseImageOptions

Returns

Promise<ChooseImageResponse>

Interface: ChooseImageOptions#

NameTypeDescription
count?numberThe maximum number of images allowed range is [1,9]
sizeType?("original" | "compressed")[]The size of the select image; valid options:- 'original';; - 'compressed'
sourceType?("album" | "camera")[]The source of the image; valid options:- 'album'; - 'camera'

Interface: ChooseImageResponse#

NameTypeDescription
tempFilePathsstring[]The list of local temporary file paths to images
tempFilesImageFile[]The local temporary file list for images