EddyVerbruggen / nativescript-local-notifications

:mailbox: NativeScript plugin to easily schedule local notifications
MIT License
162 stars 57 forks source link

Cannot read property 'class' of undefined #96

Closed Mflm closed 6 years ago

Mflm commented 6 years ago

I have this error:

Cannot read property 'class' of undefined I'm only call the function when the page loads:

exports.pageLoaded = function(args) { exports.doScheduleEveryMinute(); exports.doScheduleEveryMinute = function () { LocalNotifications.schedule([{ id: 1, class:'0', title: 'The title', body: 'The big body. The big body. The big body. The big body. The big body. The big body. The big body. The big body.', bigTextStyle: true, // Adds an 'expansion arrow' to the notification (Android only) sound: "customsound", channel: "My Awesome Channel", ticker: 'Special ticker text (Android only)', at: new Date(new Date().getTime() + (10 * 1000)) // 10 seconds from now }]).then( function() { console.log("Notification scheduled"); }, function(error) { console.log("scheduling error: " + error); } ) };

Thanks

Mflm commented 6 years ago

Maybe because I use also Nativescript-firebase

because in a new project the plugins works great

atheros commented 6 years ago

TypeError: Cannot read property 'class' of undefined JS: at file:///data/data/xxx/files/app/tns_modules/nativescript-local-notifications/local-notifications.js:132:121 I don't have firebase.

atheros commented 6 years ago
tns platform remove android
tns platform add android

fixed it.

I guess 50% of issues related to plugins can be resolved that way. I wonder how to report that kind of bug...

Mflm commented 6 years ago

Yes

Thank you