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

capacitor-timer-notification

Package Overview
Dependencies
Maintainers
0
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-timer-notification

timer notifcation

  • 0.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-76.47%
Maintainers
0
Weekly downloads
 
Created
Source

capacitor-timer-notification

A Capacitor plugin to create a timer notification that displays a countdown timer in the notification bar.

Stable Version is 0.24!!

Usage

Add the following to your android/app/src/main/AndroidManifest.xml file to declare the necessary permissions and service:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />

<service
  android:name=".TimerService"
  android:enabled="true"
  android:exported="false"
  android:foregroundServiceType="mediaPlayback"/>




## Install

```bash
npm install capacitor-timer-notification
npx cap sync

API

  • startTimer(...)
  • stopTimer()
  • pauseTimer()
  • resumeTimer()
  • addListener('remainingTimeUpdate', ...)
  • removeAllListeners(...)
  • Interfaces

startTimer(...)

startTimer(options: { duration: number; }) => Promise<void>

Starts the timer with the given duration in seconds.

ParamTypeDescription
options{ duration: number; }- Object containing the duration of the timer.

stopTimer()

stopTimer() => Promise<void>

Stops the currently running timer.


pauseTimer()

pauseTimer() => Promise<void>

Pauses the currently running timer.


resumeTimer()

resumeTimer() => Promise<void>

Resumes the paused timer.


addListener('remainingTimeUpdate', ...)

addListener(eventName: 'remainingTimeUpdate', listenerFunc: (data: { remainingTime: number; }) => void) => Promise<PluginListenerHandle>

Listens for updates on the remaining time of the timer.

ParamTypeDescription
eventName'remainingTimeUpdate'- The name of the event, e.g., "remainingTimeUpdate".
listenerFunc(data: { remainingTime: number; }) => void- Callback function that receives the remaining time.

Returns: Promise<PluginListenerHandle>


removeAllListeners(...)

removeAllListeners(eventName: string) => Promise<void>

Removes all listeners for a given event.

ParamTypeDescription
eventNamestring- The name of the event to remove listeners for.

Interfaces

PluginListenerHandle
PropType
remove() => Promise<void>

Keywords

FAQs

Package last updated on 18 Nov 2024

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