English
imageCapture
About 113 wordsLess than 1 minute
2025-12-16
Adapter for photo capture capability
Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| opts | Object | Yes | Configuration options object |
| opts.onSuccess | Function | Yes | Success callback function, receives an array of file streams |
Return Value
No return value. Photo capture results are returned through the callback function.
Success Callback Parameters (onSuccess)
| Parameter Name | Type | Description |
|---|---|---|
| files | Array | Array of images in file-stream format |
Usage Example
imageCapture(opts) {
// Call the third-party photo capture capability
window.xx.imageCapture().then((files) => {
// files are in file-stream format
opts.onSuccess(files);
}).catch((error) => {
console.error('Photo capture failed:', error);
});
}The third-party app provides a native photo capture interface and returns a Promise object.
