katzer / cordova-plugin-local-notifications

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

notification isn't repeated #64

Closed benandante closed 10 years ago

benandante commented 10 years ago

Hi, I'm working with phonegap build 3.0 and testing it on android. I tried using this plugin. here are the steps i had so far:

adding this line to config.xml

       <gap:plugin name="de.appplant.cordova.plugin.local-notification" >

including the library in index.html

       <script type="text/javascript" src="js/local-notification.js"></script>

adding the following lines of code to index.html

             var now                  = new Date().getTime(),
        _60_seconds_from_now = new Date(now + 6*1000);

        window.plugin.notification.local.add({
            id:         "1", // is converted to a string
            title:      'Reminder',
            message:    'Dont forget to buy some flowers',
            repeat:      1,
            date:       _60_seconds_from_now,
            foreground: 'foreground',
            background: 'background'
        }); 
         function foreground (id) {
               console.log('I WAS RUNNING ID='+id);
         }

      function background (id) {
              console.log('I WAS IN THE BACKGROUND ID='+id);
       }

The problem is i can see the notification once 6 seconds after the application has started. But it doesn't repeat. I tried repeat : "hourly" and still doesn't work. What am doing wrong? I would appreciate your help.

katzer commented 10 years ago

Since you are using PGB (means v0.6.3) custom repeat intervals and 'hourly' are not available. Only 'daily', 'weekly', 'monthly' and 'yearly‘.

But I think that v0.7.0beta will be available for PGB users in the next week.

katzer commented 10 years ago

PGB users have to wait for v0.7.0 since I cannot publish beta releases.

benandante commented 10 years ago

Thank you very much