wnyc / cordova-plugin-wakeuptimer

Cordova plugin for a wakeup alarm clock
90 stars 111 forks source link

Can't get it to work! #3

Closed abrararies closed 9 years ago

abrararies commented 9 years ago

Hey I've been having a really hard time getting this to work. Someone please clear some things for me.

  1. What is the actions param? What does it take?
  2. What format does sounds take (dom element or something else)?
  3. If I just provide message param (string), will it still work?

Here is my code,

var successCallback = function(result) { console.log('wakeup alarm detected-- '+ result); };

var errorCallback = function(result) { console.log('wakeup alarm detected-- '+ result); };

var alarms = { type : 'snooze', time : { seconds : 60 }, extra : { }, message : "Hello!!" }; console.log("set Alarm"); window.wakeuptimer.snooze( successCallback, errorCallback, alarms);

Right now whenever I try to set the alarm, successCallback is called immediately where result is set to null.

Please help me out. PS: I'm using it with Angualar

bkammin commented 9 years ago

successCallback be called immediately (this simply indicates that the alarm has been set), and then it should be called again after 60 seconds.

abrararies commented 9 years ago

Thanks @bkammin But it still doesn't work and the "result" variable returns NULL. Is the code right? I'm running this on IOS (8.1)

abrararies commented 9 years ago

@bkammin It would be really awesome if you could include a sample app in the repository. We really need this plugin. :(

bkammin commented 9 years ago

I'll try to get a sample app up. Meanwhile, if you are using the snooze feature of the wakeup timer, take a look at https://github.com/wnyc/cordova-plugin-sleeptimer. It does something similar.

abrararies commented 9 years ago

I was testing the snooze because it didn't need date values. I actually need to use the raise the alarm on a specific time and date. I would really appreciate a sample app. Thanks @bkammin !

bilal1101-m commented 9 years ago

@abrararies hi i just want to know did you get success in working this plugin or not? Because i am trying also but haven't any luck yet :(

wtetzner commented 9 years ago

When I create an alarm, I get a result of "OK", but then the alarm never fires.

bilal1101-m commented 9 years ago

@wtetzner yeh same thing happening to me. It shows Alarm Set Success message but when time comes it never fires

abrararies commented 9 years ago

@Blu-Angel Hey No luck yet. I am hoping tht @bkammin would add a sample app and make my life easier. ;)

bkammin commented 9 years ago

I've been swamped on other project lately and haven't had time to put together a sample app -- if you could send a sample app with your code, I'll get it working and add it to the repo.

On Wed, Jan 28, 2015 at 4:32 AM, abrararies notifications@github.com wrote:

@Blu-Angel https://github.com/Blu-Angel Hey No luck yet. I am hoping tht @bkammin https://github.com/bkammin would add a sample app and make my life easier. ;)

— Reply to this email directly or view it on GitHub https://github.com/wnyc/cordova-plugin-wakeuptimer/issues/3#issuecomment-71804908 .

bilal1101-m commented 9 years ago

@bkammin Thank that would be very nice. I will upload test app in a day or two.

bilal1101-m commented 9 years ago

@bkammin following is the link for test app https://www.dropbox.com/s/9fxh5de8pod0hch/testAlarm.rar?dl=0

I test in Mobiles and also in Genemotion Emulators but not succeed

bkammin commented 9 years ago

I created a working example in the github repository using your code - thanks for contributing. Let me know if it works for you.

On Sun, Feb 1, 2015 at 8:41 AM, Blu notifications@github.com wrote:

@bkammin https://github.com/bkammin following is the link for test app https://www.dropbox.com/s/9fxh5de8pod0hch/testAlarm.rar?dl=0

I test in Mobiles and also in Genemotion Emulators but not succeed

— Reply to this email directly or view it on GitHub https://github.com/wnyc/cordova-plugin-wakeuptimer/issues/3#issuecomment-72365109 .

wtetzner commented 9 years ago

I used the working example to get my program working. If the app is open at the time the alarm should trigger, it calls my success function. However, if my app is closed, then when the alarm time comes, it opens my app, but it doesn't call the success function.

Is there something I need to do to get that working?

bkammin commented 9 years ago

In my testing the success function was called in the sample app with the app in the background when the alarm expired (I'm testing on a Samsung S3 running 4.4.2).

You could make sure the KeepRunning flag is config.xml is not set to false (it defaults to true). If it is set to false, the execution of cordova webview code is halted when the app is in the background.

On Mon, Feb 2, 2015 at 4:38 PM, Walter Tetzner notifications@github.com wrote:

I used the working example to get my program working. If the app is open at the time the alarm should trigger, it calls my success function. However, if my app is closed, then when the alarm time comes, it opens my app, but it doesn't call the success function.

Is there something I need to do to get that working?

— Reply to this email directly or view it on GitHub https://github.com/wnyc/cordova-plugin-wakeuptimer/issues/3#issuecomment-72543328 .

bilal1101-m commented 9 years ago

@bkammin Thanks for update. and apologise for my late reply. I am testing that maybe i will have some other new questions about this plugin and i would like to start new issue with sample app soon. Thanks.

rafaelkendy commented 9 years ago

Hi, where can i find cordova.js that is missing?

bkammin commented 9 years ago

cordova.js is not included in the plugin - it is installed when you create a Cordova app (see http://cordova.apache.org)

sabirali007 commented 7 years ago

can i take sample app?