Schedule local notfication dynamically


#1

I am scheduling multiple notifications using ngCordova LocalNotification plugin like this

$cordovaLocalNotification.schedule([{
id: 123,
title: ‘1st one’,
text: ‘Text here’,
at: _10SecondsFromNow
},
{
id: 456,
title: ‘second notification’,
text: ‘Text here’,
at: _5SecondsFromNow
}
]).then(function (result) {
// …
});

Its working fine, now i want to schedule some new notifications dynamically…i tried this but it did’nt work

var newNotify= {
id: 456,
title: ‘second notification’,
text: ‘Text here’,
at: _5SecondsFromNow
};
$cordovaLocalNotification.schedule.push(newNotify);

How can I acheive that ?? Any help would be highly appreciated