# downLoadImageOrVideoForUse 保存图片到相册/复制图片到剪贴板

在H5中保存图片到手机相册中/复制图片到手机剪贴板(3.17版本原生增加了该接口)

# Attributes

属性 类型 必要 默认值 说明
url String Y - -
function Number Y - -
type Number N - -
fileName String N - -

# 调用示例

window.bridge.downLoadImageOrVideoForUse(
  { url: 'xxxx', function: 1, type: 1 },
  (res) => {
    if (res.code === 0) {
      // 保存成功
    } else if (res.code === -1) {
      // 存储空间已满
    } else if (res.code === -2) {
      // 网络异常
    } else if (res.code === -3) {
      // 资源不存在
    } else if (res.code === -5) {
      // 用户拒绝授权
    } else {
      // 未知异常
    }
  }
);

# callback

属性 类型 必要 默认值 说明
code Number Y - -

# 接口返回示例

{ "code": 0 }