|
[云开发]
【已解决】DTouch在华为鸿蒙系统下没有任何反应
[复制链接]
本帖最后由 安徽省农家书屋 于 2023-5-15 13:51 编辑
参考群里朋友写的测试代码,在手机上真机调试的时候,没有任何反应,这是啥情况
var DTouch = api.require('3DTouch');
DTouch.setShortcutItems({
items: [{
type: 'com.stm.favorites',
title: 'Favorites',
icon: {
file: 'widget/statics/image/nav/1.png'
},
userInfo: {
'myfavorites': '我的收藏'
}
}, {
type: 'com**.**pose',
title: 'New Message',
icon: {
type: 0
},
userInfo: {
'mymessage': '我的消息'
}
}]
});
if(api.systemType=="ios"){
DTouch.setListener(
function(ret, err) {
var type = ret.type;
if (type == 'com.mycompany.myapp.openfavorites') {
}
}
);
}else{
api.addEventListener({
name:'appintent'
}, function(ret){
alert(JSON.stringify(ret))
})
}
android setShortcutItems ->items->{}->subtitle 这个字段不能为空需要传值
|
|