capacitor-timer-notification
A Capacitor plugin to create a timer notification that will show a notification with a countdown timer.
Usage
Add the following to your android/app/src/main/AndroidManifest.xml
file:
<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
npm install capacitor-timer-notification
npx cap sync
API
startTimer(...)
startTimer(options: { duration: number; }) => Promise<void>
Param | Type |
---|
options | { duration: number; } |
pauseTimer()
pauseTimer() => Promise<void>
stopTimer()
stopTimer() => Promise<void>