customNotification

Method

论坛示例

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

概述

通知

插件接口

sendNotification

发送一条通知

sendNotification({params})

params

```js { 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);
                                           }
                                  }```

示例代码

```js 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

js { 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); } }

示例代码

js 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

示例代码

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

可用性

Android,ios系统

可提供的1.0.6

是否仍需要帮助? 请保持联络!
最后更新于 2024/11/18