chooseImage(params: Object)
Requires:
BaseKit≥2.0.1@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
Description
Select images from the local album or take photos with the camera. You can use chooseMedia instead.
Permissions: [scope.camera, scope.writePhotosAlbum]
Related API: [chooseMedia]
Parameters
| Property | Type | Required | Default | Description | BaseKit Since |
|---|---|---|---|---|---|
count | number | No | 9 | Maximum number of images to select. Note: On Android 13 and above, the system image picker is used and this field has no effect | - |
imageType | string | No | - | Filter image types; pass 'gif' to show only GIFs, pass 'image' to show non-GIF static images; if omitted or empty, no filtering by default | v3.32.13 |
sizeType | string[] | No | - | Image size type; pass 'original' for the original image, 'compressed' for a compressed image | - |
sourceType | string[] | No | - | Source for selecting images ['album', 'camera'] | - |
disableDismissAnimationAfterSelect | boolean | No | - | Whether to disable the animation when closing the interface after canceling image selection | v3.11.3 |
complete | () => void | No | - | Completion callback (executed on both success and failure) | - |
success | (params: Object) => void | No | - | Callback on successful API call | - |
fail | (params: Object) => void | No | - | Failure callback | - |
success callback parameters
| Property | Type | Description | BaseKit Since |
|---|---|---|---|
tempFilePaths | string[] | List of local temporary image file paths (local paths) | v3.2.6 |
| List of selected image file objects, including the local temporary file path path and file size size (in bytes) | v3.2.6 |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None