0

I am trying to use local notification in phonegap. Here the local notification is working properly but i am not able to see the multiple notifications. Actually all are coming but it is getting overwrited. So I am not able to see everything, I will be able to see the last notification only. Also, when ever I open the app, all the notifications are showing up again. It is showing correctly on time as well. I just want to show the notif on time alone.

var dd = new Date();
dd.setHours(20); 
dd.setMinutes(0);
dd.setSeconds(0);
for(var i=0; i < results.rows.length; i++)
 {
 var a=results.rows.item(i).medicine_name;
 var o=new String("Time to take a "+a);
 var mor=results.rows.item(i).tm_1;
 var aft=results.rows.item(i).tm_2;
 var nig=results.rows.item(i).tm_3;
 if(mor==0&&aft==1&&nig==1)
  {
    window.plugin.notification.local.add({ message: o,date: da });
    window.plugin.notification.local.add({ message: o,date: dd});
  }
 }

This is a part of the code.

V.V
  • 107
  • 1
  • 1
  • 10
  • In android all notification have to have an ID on which the system determines whether another notify would overwrite a currently shown notify with the same ID. So just for android you have to "tell" the plugin to create a notify that's ID differs from a former notify ID. On other platforms it might be the same issue. – Blauharley Apr 04 '15 at 21:46
  • And on windows phone 8.1 when using shelltoast to display some messages outside an app successive messages get not overwriten even if you call shelltoast several times again so you get a lot of messages stacked opun each other. On WP-8 (older than 8.1) it could be the same. – Blauharley Apr 08 '15 at 18:18

0 Answers0