简体   繁体   English

科尔多瓦-插件失眠不起作用

[英]cordova-plugin-insomnia not working

I follow the instructions written there: https://www.npmjs.com/package/cordova-plugin-insomnia 我按照那里写的说明进行操作: https//www.npmjs.com/package/cordova-plugin-insomnia

  1. cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git cordova插件添加https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
  2. cordova prepare 科尔多瓦准备

Then in index.js i wrote : 然后在index.js中,我写道:

 if (window.plugins.insomnia && window.plugins.insomnia.keepAwake) { window.plugins.insomnia.keepAwake(onSuccess,onError); } else { alert("insomnia plugin missing"); } 

onSuccess is correctly invoked and executed. onSuccess已正确调用并执行。 So i assumed the installation is correct. 所以我认为安装正确。

But the screen of my SamSung Galaxy XCover 3 running on Android 5.1.1 sleeps after few seconds. 但是几秒钟后,在Android 5.1.1上运行的我的Samsung Galaxy XCover 3的屏幕就会休眠。 Cordova 6.3.1 科尔多瓦6.3.1

Do you have an idea of what's wrong ? 你有什么想法吗?

Thanks 谢谢

类似于问题github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/issues/29,我不再使用失眠症了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM