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

Property ScreenLocker does not exist on type window. #9

Open
ravisojitra opened this issue May 9, 2017 · 4 comments
Open

Property ScreenLocker does not exist on type window. #9

ravisojitra opened this issue May 9, 2017 · 4 comments

Comments

@ravisojitra
Copy link

i want to use this in ionic 2 app but it's saying that Property ScreenLocker does not exist on type window.
how to fix this error?

@kitolog
Copy link
Owner

kitolog commented May 10, 2017

as I remember, ionic 2 using angular 2 infrastructure, you should get access to window property first

@ravisojitra
Copy link
Author

Actually i have access to window object and it's also getting printed in console with its properties but i can not find screenlocker on window object.

@yurik94
Copy link

yurik94 commented Nov 17, 2017

Not working....

@Nuajan
Copy link

Nuajan commented Aug 30, 2019

Found a workaround for this on https://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native/
Just declare an any type directly on the window, i.e:
(<any>window).screenLocker.unlock(function() {...

That worked for me, using:
ionic cli 5.2.6
ionic type: angular
cordova 9.0.0 ([email protected])
cordova platform android 8.0.0

Hope this helps, even 2 years after....

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