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

Can not make it work on a Nativescript-Vue project #6

Closed
RosilBelli opened this issue Jun 25, 2018 · 7 comments
Closed

Can not make it work on a Nativescript-Vue project #6

RosilBelli opened this issue Jun 25, 2018 · 7 comments
Labels
Milestone

Comments

@RosilBelli
Copy link

Hi!
I'm trying to use this plugin within a nativescript-vue project but I aways get this error when keepAwake is called:

TypeError: Cannot read property 'getWindow' of undefined'

Actually, I'm trying to run on android platform. Nativescript version is 4.1.

Thanks!

@LorenDorez
Copy link

@RosilBelli not sure if you still need help with this. I found in my NativeScript-Javascript project i was calling the KeepAwake too early. Once i moved it to like a page load it worked just fine

@RosilBelli
Copy link
Author

Hi @LorenDorez!

Thanks for your reply. I'm going to try that too and see if it works on my project as soon as I can!

@LorenDorez
Copy link

I was trying to load my on the App Launch Event and it was crashing

@EddyVerbruggen
Copy link
Member

For anyone reading this: it's not specifically related to Vue because if you do this too early in fi. an Angular app you get the same error (just call keepAwake in main.ts before bootstrapModule).

To harden against this type of usage (you may rethink whether or not you want your app to always keep the screen on though) I'll have the plugin listen to the activityStarted event in case there is no activity available yet when using keepAwake (not doing it for allowSleepAgain as that seems totally unnecessary).

@EddyVerbruggen
Copy link
Member

Available in 1.2.2, right now.

@LorenDorez
Copy link

@EddyVerbruggen
The change you made to the no activity feature is causing an issue for me. I have a GPS Monitoring module in my app to track a Security guard and i need the screen to stay away while he is in patrolling mode hence the need for this plugin. However now with this above up the screen eventually timesout and on android if the screen/phone sleeps the GPS monitoring goes to like a 30min polling cycle to conserve battery. Can we maybe add a flag to bypass this new update/feature?

@LorenDorez
Copy link

NVM appears im still running the older version and getting reports of phones still sleeping. ill create a new issue

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

No branches or pull requests

3 participants