Open Olexiy665 opened 8 years ago
+1
Hello, I've not tested this plugin yet, but you can try:
ionic plugin add https://github.com/wnyc/cordova-plugin-wakeuptimer.git
on your ts file, add before class definition
declare var window;
and on you class you can do something like
...
public initializeAlarms(): void {
window.wakeuptimer.wakeup(
() => {
console.log("success callback")
},
() => {
console.log("error callback")
},
// a list of alarms to set
{
alarms : [
{
type : "onetime",
time : { hour : 14, minute : 30 },
extra : { message : "Lorem ipsum" },
message : "Alarm has expired!"
}
]
}
);
}
...
hope i helped :)
i tried your approach @EltonFaust , but its giving the following error.
Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch plugin https://github.com/wnyc/cordova-plugin-wakeuptimer.git via registry. Probably this is either a connection problem, or plugin spec is incorrect
can you help me regarding this??
Thanks in Advance :)
Hello,
which node/npm version are you using?
the newer versions of npm requires a package.json file (npm 6 and newer i guess), something that old packages doesnt contains, that is probabily the reason of this error,
i've forked this project and made some changes, if you like, you could opt to add mine instead,
cordova plugin add https://github.com/EltonFaust/cordova-plugin-wakeuptimer.git
Thank you @EltonFaust :) I will try your plugin
Hi, how can I use this awesome plugin in the ionic 2 typescript application?