customNotification

立即使用

Method

sendNotification updateNotification

论坛示例

为帮助用户更好更快的使用模块,论坛维护了一个示例,示例中包含示例代码、知识点讲解、注意事项等,供您参考。

概述

通知

模块接口

sendNotification

发送一条通知

sendNotification({params})

params

  1. {
  2. channelId:'chat',
  3. channelName:'消息通知',
  4. smallIcon:'widget://icon/qianniu.png',
  5. bigIcon:'widget://icon/qianniu.png',
  6. title:'消息通知111',
  7. msgOne:{text:'处罚及预警',num:10},
  8. msgTwo:{text:'售后服务',num:5},
  9. msgThree:{text:'货源消息',num:4},
  10. msgFour:{text:'其他消息',num:1}
  11. },function(ret) {
  12. if (ret.code==0) {
  13. alert(ret.msg);
  14. }
  15. }

示例代码

  1. var notification = api.require('customNotification');
  2. notification.sendNotification({
  3. channelId:'chat',
  4. channelName:'消息通知',
  5. smallIcon:'widget://icon/qianniu.png',
  6. bigIcon:'widget://icon/qianniu.png',
  7. title:'消息通知111',
  8. msgOne:{text:'处罚及预警',num:10},
  9. msgTwo:{text:'售后服务',num:5},
  10. msgThree:{text:'货源消息',num:4},
  11. msgFour:{text:'其他消息',num:1}
  12. },function(ret) {
  13. if (ret.code==0) {
  14. alert(ret.msg);
  15. }
  16. });

可用性

Android,ios系统

可提供的1.0.0

updateNotification

更新通知

updateNotification({params})

params

  1. {
  2. smallIcon:'widget://icon/qianniu.png',
  3. bigIcon:'widget://icon/qianniu.png',
  4. title:'消息通知11122222222',
  5. msgOne:{text:'处罚及预警',num:60},
  6. msgTwo:{text:'售后服务',num:5},
  7. msgThree:{text:'货源消息',num:4},
  8. msgFour:{text:'其他消息',num:1}
  9. },function(ret) {
  10. if (ret.code==0) {
  11. alert(ret.msg);
  12. }
  13. }

示例代码

  1. var notification = api.require('customNotification');
  2. notification.updateNotification({
  3. smallIcon:'widget://icon/qianniu.png',
  4. bigIcon:'widget://icon/qianniu.png',
  5. title:'消息通知11122222222',
  6. msgOne:{text:'处罚及预警',num:60},
  7. msgTwo:{text:'售后服务',num:5},
  8. msgThree:{text:'货源消息',num:4},
  9. msgFour:{text:'其他消息',num:1}
  10. },function(ret) {
  11. if (ret.code==0) {
  12. alert(ret.msg);
  13. }
  14. });

可用性

Android,ios系统

可提供的1.0.0

示例代码

  1. var office = api.require('officePreview');
  2. office.show();

可用性

Android,ios系统

可提供的1.0.6