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

cordova-simple-timer

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-simple-timer

Simple timer plugin which uses Android AlarmManager

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54
decreased by-29.87%
Maintainers
1
Weekly downloads
 
Created
Source

cordova-simple-timer

Simple timer plugin which uses Android AlarmManager

Installation

$ cordova plugin add https://www.github.com/dukhanov/cordova-simple-timer

Android

cordova build android

Plugin API

It has been currently stripped to the minimum needed from a Javascript app.

The following functions are available:

  • SimpleTimer.start(listener, error, config). Start timer with 1 minute interval (by default)
    • listener: called on timer tick
    • error: called on function error
    • config: plugin config
    • config.interval: timer interval in milliseconds (minimum is 30000)
    • config.useWakelock: use PowerManager.WakeLock (default is false)
  • SimpleTimer.stop(success, error). Stop timer
    • success: called on function success
    • error: called on function error

Sample usage code

function onTimerTick() {
    console.log('timer tick');
}

function errorStart(message) {
    console.log('timer start failed: ' + message);
}

function onStopped() {
    console.log('timer is stopped');
}

var config = {
    interval: 60000, // 60 seconds
    useWakelock: false
}

// Start
SimpleTimer.start(onTimerTick, errorStart, config);

// Stop
SimpleTimer.stop(onStopped)

Keywords

FAQs

Package last updated on 19 Jun 2019

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