customNotification
Method
sendNotification updateNotification
论坛示例
为帮助用户更好更快的使用模块,论坛维护了一个示例,示例中包含示例代码、知识点讲解、注意事项等,供您参考。
概述
通知
模块接口
sendNotification
发送一条通知
sendNotification({params})
params
{
channelId:'chat',
channelName:'消息通知',
smallIcon:'widget://icon/qianniu.png',
bigIcon:'widget://icon/qianniu.png',
title:'消息通知111',
msgOne:{text:'处罚及预警',num:10},
msgTwo:{text:'售后服务',num:5},
msgThree:{text:'货源消息',num:4},
msgFour:{text:'其他消息',num:1}
},function(ret) {
if (ret.code==0) {
alert(ret.msg);
}
}
示例代码
var notification = api.require('customNotification');
notification.sendNotification({
channelId:'chat',
channelName:'消息通知',
smallIcon:'widget://icon/qianniu.png',
bigIcon:'widget://icon/qianniu.png',
title:'消息通知111',
msgOne:{text:'处罚及预警',num:10},
msgTwo:{text:'售后服务',num:5},
msgThree:{text:'货源消息',num:4},
msgFour:{text:'其他消息',num:1}
},function(ret) {
if (ret.code==0) {
alert(ret.msg);
}
});
可用性
Android,ios系统
可提供的1.0.0
updateNotification
更新通知
updateNotification({params})
params
{
smallIcon:'widget://icon/qianniu.png',
bigIcon:'widget://icon/qianniu.png',
title:'消息通知11122222222',
msgOne:{text:'处罚及预警',num:60},
msgTwo:{text:'售后服务',num:5},
msgThree:{text:'货源消息',num:4},
msgFour:{text:'其他消息',num:1}
},function(ret) {
if (ret.code==0) {
alert(ret.msg);
}
}
示例代码
var notification = api.require('customNotification');
notification.updateNotification({
smallIcon:'widget://icon/qianniu.png',
bigIcon:'widget://icon/qianniu.png',
title:'消息通知11122222222',
msgOne:{text:'处罚及预警',num:60},
msgTwo:{text:'售后服务',num:5},
msgThree:{text:'货源消息',num:4},
msgFour:{text:'其他消息',num:1}
},function(ret) {
if (ret.code==0) {
alert(ret.msg);
}
});
可用性
Android,ios系统
可提供的1.0.0
示例代码
var office = api.require('officePreview');
office.show();
可用性
Android,ios系统
可提供的1.0.6