Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ionic2 #18

Open
Olexiy665 opened this issue Aug 5, 2016 · 5 comments
Open

Using ionic2 #18

Olexiy665 opened this issue Aug 5, 2016 · 5 comments

Comments

@Olexiy665
Copy link

Hi, how can I use this awesome plugin in the ionic 2 typescript application?

@evandrojr
Copy link

+1

@EltonFaust
Copy link

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 :)

@polisettyManoj
Copy link

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 :)

@EltonFaust
Copy link

EltonFaust commented Jan 30, 2018

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

@polisettyManoj
Copy link

Thank you @EltonFaust :) I will try your plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants