This plugin allow to set an alarm. When the alarm trigger the app is launched and shown even on the lock screen of the phone. The user will see the alarm clock icon is the status bar and on the lock screen.
When the alarm is triggered a new webview is created and shown on top of the lock screen. Use the function "isFromAlarmTrigger" to know if the app was started by the alarm plugin.
Android with Ionic only. The lock screen webview uses IonicWebViewEngine, it could be replaced by CordovaWebViewEngine to work for Cordova.
cordova plugin add https://github.com/ElieSauveterre/cordova-plugin-alarm
- Add
window.alarm.add(successCallback, errorCallback, {
date: '2019-03-08 08:06:00'
});
- Remove
window.alarm.remove(successCallback, errorCallback);
- Snooze
window.alarm.snooze(successCallback, errorCallback);
- Stop
window.alarm.stop(successCallback, errorCallback);
- Check if app was started by the alarm
The success callback return true when the webview was started by the alarm
window.alarm.isFromAlarmTrigger(successCallback, errorCallback);