Я использовал Push Plugin, когда я отправляю push с кнопкой действия 1) принимаю 2) игнорировать.Cordova Android Push Notification With Action Button
Когда было получено уведомление, меня нажали на кнопку «принять». но мне нужны параметры с обратным вызовом кнопки «accept». из которого я буду идентифицироваться с уведомлением «accept».
код ссылки
//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" является обратный вызов кнопки "Accept" ..
Пожалуйста, помогите мне как можно скорее. Спасибо ..
Спасибо, много, это решение было действительно выполнено .. –