olivierlesnicki / cordova-ios-LocalNotification

6 stars 7 forks source link

didReceiveLocalNotification not firing #3

Closed domwebb closed 11 years ago

domwebb commented 11 years ago

Created a brand new 2.3.0 project, added the plugin as per the instructions but the notification function and notificatioId that are called after you click the local notification alert are not firing, thus I cant tell which notificationId has loaded the app.

I used the downloadable zip file and not a git clone as an FYI

olivierlesnicki commented 11 years ago

didReceiveLocalNotification act as an observer on NSNotificationCenter. By default in Cordova the NSNotificationCenter is commented out. You need to comment it back in by editing CordovaLib/Classes/CDVPlugin.m and CordovaLib/Classes/CDVPlugin.h. Please see updated README.md - do let me know if it doesn't solve your issue.

domwebb commented 11 years ago

Thanks, this worked. As an FYI Im running Phonegap 2.4 and it works fine.

Slightly separate issue, the cancelNotification() function, is it actually working (it isnt on my app). Would you like me to open a new issue on here?

window.cancelNotification = function(str, callback) {
    cordova.exec(null, null, "LocalNotification", "cancelNotification", null);
}; 

seems to not be passing any notification id, thus isn't going to cancel a specific notification?

olivierlesnicki commented 11 years ago

Thanks for the feedback. The logic exist within the LocalNotification.m and .h files. I will need to pass it as an argument within the 'window.cancelNotification' function. I've opened a new issue for this.