katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.75k forks source link

getAll() ,getAllScheduled() undefined #1522

Closed bhumin3i closed 6 years ago

bhumin3i commented 6 years ago

i am getting error :

setTimeout(function() {
              this.localNotifications.getAll(function (notifications) {
                console.log("getAll notifications: ");
                console.log(notifications);
              });
            }, 5000);

ON CONSOLE

ERROR TypeError: Cannot read property 'getAll' of undefined at 5.js:458 at t.invokeTask (polyfills.js:3) at Object.onInvokeTask (vendor.js:5284) at t.invokeTask (polyfills.js:3) at r.runTask (polyfills.js:3) at e.invokeTask (polyfills.js:3) at i.isUsingGlobalCallback.invoke (polyfills.js:3) at n (polyfills.js:3)

:(

rwillett commented 6 years ago

No template, not enough information, no plugin version, no OS version.

The template is there for a reason, I suspect that you have 'this' wrong but no idea really. .getAll() works as we use it.

katzer commented 6 years ago

Usually indicates that the plugin isn't installed or not loaded/available.