Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-wakuptimer-jk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-wakuptimer-jk

Wakeup Plugin

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Wakeup/Alarm Clock PhoneGap/Cordova Plugin

Platform Support

This plugin supports PhoneGap/Cordova apps running on both iOS and Android.

Version Requirements

This plugin is meant to work with Cordova 3.5.0+.

Installation

Automatic Installation using PhoneGap/Cordova CLI (iOS and Android)
  1. Make sure you update your projects to Cordova iOS version 3.5.0+ before installing this plugin.

     cordova platform update ios
     cordova platform update android
    
  2. Install this plugin using PhoneGap/Cordova cli:

     cordova plugin add https://github.com/wnyc/cordova-plugin-wakeuptimer.git
    

Usage

// all responses from the audio player are channeled through successCallback and errorCallback

// set wakeup timer
window.wakeuptimer.wakeup( successCallback,
   errorCallback,
   // a list of alarms to set
   {
        alarms : [{
            type : 'onetime',
            time : { hour : 14, minute : 30 },
            extra : { message : 'json containing app-specific information to be posted when alarm triggers' },
            message : 'Alarm has expired!'
       }]
   }
);

// set repeating wakeup timer
window.wakeuptimer.wakeup( successCallback,
   errorCallback,
   // a list of alarms to set
   {
        alarms : [{
            type : 'repeating',
            time : { minutes : 10 },
            extra : { message : 'json containing app-specific information to be posted when alarm triggers' },
            message : 'Alarm has expired!'
       }]
   }
);

// set timer, but skip launch if user is using the phone (screen is on)
window.wakeuptimer.wakeup( successCallback,
   errorCallback,
   // a list of alarms to set
   {
        alarms : [{
            type : 'onetime',
            skipOnAwake: true,
            time : { hour : 12, minute : 10 },
            extra : { message : 'json containing app-specific information to be posted when alarm triggers' },
            message : 'Alarm has expired!'
       }]
   }
);

// set wakeup timer, but skip launch if app is already running
window.wakeuptimer.wakeup( successCallback,
   errorCallback,
   // a list of alarms to set
   {
        alarms : [{
            type : 'onetime',
            skipOnRunning: true,
            time : { hour : 11, minute : 20 },
            extra : { message : 'json containing app-specific information to be posted when alarm triggers' },
            message : 'Alarm has expired!'
       }]
   }
);

// snooze...
window.wakeuptimer.snooze( successCallback,
    errorCallback,
    {
        alarms : [{
            type : 'snooze',
            time : { seconds : 60 }, // snooze for 60 seconds
            extra : { }, // json containing app-specific information to be posted when alarm triggers
            message : this.get('message'),
            sound : this.get('sound'),
            action : this.get('action')
        }]
    }
 );

// example of a callback method
var successCallback = function(result) {
    if (result.type==='wakeup') {
        console.log('wakeup alarm detected--' + result.extra);
    } else if(result.type==='set'){
        console.log('wakeup alarm set--' + result);
    } else {
        console.log('wakeup unhandled type (' + result.type + ')');
    }
};

Keywords

FAQs

Package last updated on 28 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc