# ks.addShortcut

添加小游戏快捷方式到手机桌面上

请求 object

字段名 类型 描述 values
success function 接口调用成功的回调函数
fail function 接口调用失败的回调函数
complete function 接口调用结束的回调函数(调用成功、失败都会执行)

回调成功

字段名 类型 描述 values
code int 1 表示成功
msg string "addShortcut:ok"

回调失败

字段名 类型 描述 values
code int 异常错误码
msg string "addShortcut:fail"

example

ks.addShortcut({
  success() {
    console.log("添加桌面成功");
  },
  fail(err) {
    if (err.code === -10005) {
        console.log("暂不支持该功能");
    } else {
        console.log("添加桌面失败", err.msg);
    }
  },
});