Closed salem0426 closed 5 years ago
Additional information regarding Notifications working for the first time: Receives a one time only pop-up asking to allow Notifications for iOS Application
Neglected to indicate that this issue is with iOS devices only. Notifications for this App on Android phones works just fine.
The issue is in your code, debug your javascript and check if all your variables are set correct. Especially this piece of code:
actions: [
acts
function(data){
console.log("Notification callback: ",data);
}
]
What is acts
?
You need to provide the actions like this:
actions: [
{ id: 'firstAction', title: 'Your first action' },
{ id: 'secondAction', title: 'Your second action' }
]
And catch them like this:
cordova.plugins.notification.local.on('firstAction', function (data, eopts) {
// Your code
});
cordova.plugins.notification.local.on('secondAction', function (data, eopts) {
// Your code
});
Steffaan: Thank you for responding. I am looking to use cordova.plugins.notification.local.schedule to be called from my App with a message argument.
Every time the function is called, cordova.plugings.notification.local.schedule displays the message.
Currently, this only works for the initial call and not for any other calls.
Any suggestions on how to get this to work would be most appreciated! Thanks, salem0426
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
First notification is successful. Every other notification crashes the app
Your Environment
cordova -v
): 8.1.2 (cordova-lib@8.1.1)cordova platform ls
): Installed platforms: ios 4.5.5Expected Behavior
Notification pop-ups work every time
Actual Behavior
First notification is successful. Every other notification crashes the app in UNUserNotificationCenter(APPLocalNotification) getNotificationWithID Line 131
Steps to Reproduce
Happens consistently
Context
Code snippet: cordova.plugins.notification.local.schedule({ title: 'PEARL Alert', text:inText, smallIcon: 'res://noti-logo.png', icon: 'file://img/noti-logo.jpg', vibrate:true, lockscreen:true, foreground: true, actions: [ acts function(data){ console.log("Notification callback: ",data); } ] });
Debug logs
Include iOS / Android logs