Wizcorp / phonegap-plugin-localNotifications

PhoneGap plugin for providing native local notification system to JavaScript.
MIT License
38 stars 29 forks source link

triggering only one notification #22

Closed avishayhajbi closed 9 years ago

avishayhajbi commented 9 years ago

i'm using cordova 3.5.0 and when i execute two notification with different id only the last notification appear. how to fix it ?

aogilvie commented 9 years ago

Please post sample code, length of the string and the platform you are using.

avishayhajbi commented 9 years ago

var time = new Date().getTime(); var options= { repeat : 'yearly', seconds : 1, title : "notification", message : "somthing", icon : "icon", badge : time }; localNotification.add(time,options);

that's my code .

aogilvie commented 9 years ago

@avishayhajbi what platform and device?

avishayhajbi commented 9 years ago

device galaxy s3 platform phonegap 3.4.0 cordova 3.5.0

aogilvie commented 9 years ago

@avishayhajbi sorry for the late reply:

I was not able to reproduce your problem. Your code only shows one notification. I was able to make two notifications. I push a fix to use callbacks to the add() api. Here is a working example below:

var options = {
    "message" : "testing",
    "seconds" : 10,
    "badge" : 1,
    "title" : "first"
};
window.localNotification.add(1, options, function () {

    successCb();
    var newOptions = {
        "message" : "testing",
        "seconds" : 11,
        "badge" : 1,
        "title" : "second"
    };
    window.localNotification.add(2, newOptions, function () {
        alert("second finished");
        successCb();
        }, failureCb);

}, failureCb);

screenshot_2014-10-06-16-51-49

aogilvie commented 9 years ago

No reply. Closing.