mardi 26 septembre 2017

On running Ember Cordova app on phone, Got error - Cannot read property 'notification' of undefined

Installed cordova-plugin-local-notifications and retried it. The line of code where the error occures -

cordova.plugins.notification.local.on("click", function (notification) {

Error:-

Error while processing route: dashboard Cannot read property 'notification' of undefined TypeError: Cannot read property 'notification' of undefined

On commenting that line, I got another error for the immediate next line

states[Connection.UNKNOWN] = 'Unknown connection';

Again giving an error saying connection doesn't exist. I assumed that there's some cordova package or dependency missing. But running this same lines of code on anoher app's application.js, gave no such error. there was nothing related to cordova missing from package and bower json files, when comparing the app that worked, with the one that didn't.

Also in this case, cordova didn't have the function plugin. But the other app that had the same packages and lines of code in application.js, had plugin in cordova object.




Aucun commentaire:

Enregistrer un commentaire