我已经使用Push Plugin,当我发送推动按钮1)接受2)忽略。科尔多瓦Android推动通知与行动按钮
当通知来了,我被点击了“接受”按钮。但我想用“接受”按钮回调参数。从那我会确定与通知的“接受”被称为。
码参考
//initialization of push object
var push = PushNotification.init({
"android": {
"alert": "true",
"senderID": CONFIG.PROJECT_NUMBER,
"icon": "img/ionic.png",
"iconColor": "blue",
"badge": "true"
},
"ios": {
"alert": "true",
"badge": "true",
"sound": "true"
},
"windows": {
}
});
//listner for getting registration detail of device
push.on('registration', function(data) {
device_id_for_push=data.registrationId;
});
//listner called on new push notification
push.on('notification', function(data) {
// app.onPushAccept(data);
alert("on notification");
alert(JSON.stringify(data));
});
//error listner
push.on('error', function(e) {
// alert(e);
// alert("push error");
});
app.onPushAccept=function(data){
alert("onPushAccept")
alert(JSON.stringify(data));
// cordova.plugins.notification.badge.clear();
// cordova.plugins.notification.badge.increase();
}
代码 “app.onPushAccept” 功能是 “接受” 按钮的回调..
请尽快帮助我。 谢谢。
非常感谢你,这个解决方案真的很有用.. –