ios云打包后,上传到testflight测试,调用launchMiniProgram成功唤起小程序,从小程序返回app后不执行回调。但是在ios自定义基座上运行时正常执行回调
plus.share.getServices(
(res) => {
let sweixin = "";
for (var i = 0; i < res.length; i++) {
let t = res[i];
if (t.id == "weixin") {
sweixin = t;
}
}
if (sweixin) {
sweixin.launchMiniProgram(
{
id: "",
path: ``,
type: 1, // 与基座运行一样,打开开发版小程序
},
(res2) => {
// ios云打包后再testflight中测试,无法执行回调
console.log("小程序返回成功:", res2);
uni.showModal({
title: "成功回调",
content: res2,
success: function (res) {
if (res.confirm) {
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
},
});
},
(err2) => {
console.error("小程序跳转失败:", err2);
uni.showModal({
title: "失败回调",
content: err2,
success: function (res) {
if (res.confirm) {
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
},
});
}
);
} else {
uni.showToast({
icon: "none",
title: "当前环境不支持微信操作!",
});
}
},
(err) => {
console.log(err);
}
);
0 个回复