Josef Carlsson
Josef Carlsson

Reputation: 41

Schedule multiple local notifications

Im using the local notifications plug-in https://github.com/katzer/cordova-plugin-local-notifications, and i'm trying to schedule multiple notifications but I only get the first one. It has something to do with the id, but I don't know if it suppose to be a object or a value I've been tracing this everywhere and are really grateful for all help!

var now = new Date().getTime(),
_60_seconds_from_now = new Date(now + 30*1000);
_120_seconds_from_now = new Date(_60_seconds_from_now.getTime() + 60*1000),

window.plugin.notification.local.add({
        id:      28,
        title:   'Reminder',
        message: 'Dont forget to buy some ds.',
        repeat:  'minutely',
        date:    _60_seconds_from_now
        });

window.plugin.notification.local.add({
        id:      27,
        title:   'Reminder',
        message: 'Dont forget to buy some dsfsdafsdafsdaf.',
        repeat:  'minutely',
        date:    _120_seconds_from_now
        });

Upvotes: 1

Views: 747

Answers (1)

Binod Pariyar
Binod Pariyar

Reputation: 3

I think by making repeat minutely first one is overlapping the second one... make sense ??

Upvotes: 1

Related Questions