planNotify 封装了自定义通知。
targetSdkVersion需要设置到26或以上。targetSdkVersion设置
使用此插件之前需先配置 config.xml 文件,方法如下
<feature name="planNotify">
   <param  name="androidChannelId" value="11"/>
   <param  name="androidChannel" value="appchannel"/>
   <param  name="androidChannelDes" value="notification description"/>
    
    </feature>
字段描述:
androidChannelId:安卓8.0推送渠道配置,渠道id。后台通过此渠道id推送
androidChannel:安卓8.0推送渠道配置,渠道名称。
androidChannelDes:安卓8.0推送渠道配置,渠道描述。
打开自定义通知
open({params},callback(ret))
ret:
{
status:,                       //布尔类型;是否打开成功
}
err:
{
msg:,                       //字符串类型;错误信息
}
点击事件,点击会重新打开主页面并传递参数,参数通过api.addEventListener({name:'appintent'}接口监听
planNotifyClick:
var planNotify = api.require('planNotify');
planNotify.open({
    
}, function(ret, err) {
api.alert({msg: JSON.stringify(ret)});
});
Android系统
可提供的1.0.0及更高版本
关闭自定义通知
close({params},callback(ret))
ret:
{
status:,                       //布尔类型;是否关闭成功
}
err:
{
msg:,                       //字符串类型;错误信息
}
var planNotify = api.require('planNotify');
planNotify.close({
    
}, function(ret, err) {
api.alert({msg: JSON.stringify(ret)});
});
Android系统
可提供的1.0.0及更高版本
计划提醒通知
planRemind({params},callback(ret))
notifyId:
localId:
tripId:
title:
content:
extra:
ret:
{
status:,                       //布尔类型;是否成功
notifyId:,                 //数字类型;通知id
}
err:
{
msg:,                       //字符串类型;错误信息
}
点击事件,点击会重新打开主页面并传递以下参数,参数通过api.addEventListener({name:'appintent'}接口监听
localId:
tripId:
var planNotify = api.require('planNotify');
planNotify.planRemind({
notifyId:10,
    localId:'',
    tripId:'',
    title:'',
    content:'',
}, function(ret, err) {
api.alert({msg: JSON.stringify(ret)});
});
Android系统
可提供的1.0.0及更高版本
取消提醒
cancleRemind({params},callback(ret))
notifyId
ret:
{
status:,                       //布尔类型;是否关闭成功
}
err:
{
msg:,                       //字符串类型;错误信息
}
var planNotify = api.require('planNotify');
planNotify.cancleRemind({
    notifyId:,
}, function(ret, err) {
api.alert({msg: JSON.stringify(ret)});
});
Android系统
可提供的1.0.0及更高版本
设置计划提醒通知中【将此事项标记已完成】点击监听
setFinishPlanListener({params},callback(ret))
ret:
{
status:,                       //布尔类型;监听设置成功
localId:'',                   //字符串类型;planRemind接口中传入的本地行程id
tripId:'',                    //字符串类型;planRemind接口中传入的行程id
extra:'',                   //字符串类型;planRemind接口中传入的附加字段
notifyId:'',            //字符串累心;点击的通知id
}
err:
{
msg:,                       //字符串类型;错误信息
}
var planNotify = api.require('planNotify');
planNotify.setFinishPlanListener({
}, function(ret, err) {
api.alert({msg: JSON.stringify(ret)});
});
Android系统
可提供的1.0.0及更高版本
取消计划提醒通知中【将此事项标记已完成】点击监听
cancleFinishPlanListener({params},callback(ret))
ret:
{
status:,                       //布尔类型;是否取消成功
}
err:
{
msg:,                       //字符串类型;错误信息
}
var planNotify = api.require('planNotify');
planNotify.cancleFinishPlanListener({
}, function(ret, err) {
api.alert({msg: JSON.stringify(ret)});
});
Android系统
可提供的1.0.0及更高版本
