NotifyPlugin
简介
一个即可发送通知取消通知且还监听通知栏内容获取通知消息容的插件(相应权限获取判断插件内部都已处理好)
预览
![](https://i-blog.csdnimg.cn/blog_migrate/b1f534b2c8130cdd57e39d618ef766a1.png)
引用
const notifyModule = uni.requireNativePlugin("Chen-Notify")
onStartNotifyListen(CACLLBACK)
开启监听通知栏内容事件
CACLLBACK参数说明
参数 | 类型 | 说明 |
---|---|---|
success | Boolean | 操作状态 |
code | Int | 状态码(200:操作成功,400:用户操作异常,500:插件内部操作异常) |
msg | String | 返回信息 |
示例
onStartNotifyListen(){notifyModule.onStartNotifyListen((result) => {uni.showToast({title: 'result:' + JSON.stringify(result),icon:"none"}) })
},
onStopNotifyListen(CACLLBACK)
停止监听通知内容事件