Taro.saveImageToPhotosAlbum(option)
Saves images to the system album. User Authorization is required for scope.writePhotosAlbum before this API is called.
Type
(option: Option) => Promise<CallbackResult>
Parameters
Option
Property | Type | Required | Description |
---|---|---|---|
filePath | string | Yes | The path to the image file. It can be a temporary or permanent file path. The path to a network image is not supported. |
complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail | (res: any) => void | No | The callback function for a failed API call |
success | (res: Result) => void | No | The callback function for a successful API call |
Sample Code
Taro.saveImageToPhotosAlbum({
success: function (res) { }
})
API Support
API | WeChat Mini-Program | Baidu Smart-Program | Alipay Mini-Program | H5 | React Native |
---|---|---|---|---|---|
Taro.saveImageToPhotosAlbum | ✔️ | ✔️ | ✔️ | ✔️ |