Socket
Socket
Sign inDemoInstall

cordova-simple-timer

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-simple-timer

Simple timer plugin which uses Android AlarmManager


Version published
Weekly downloads
43
decreased by-12.24%
Maintainers
1
Install size
20.8 kB
Created
Weekly downloads
 

Readme

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

Last updated on 19 Jun 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc