科尔多瓦-插件失眠不起作用 [英] cordova-plugin-insomnia not working
问题描述
我按照此处写的说明进行操作: https://www.npmjs.com/package/cordova-plugin-失眠
I follow the instructions written there: https://www.npmjs.com/package/cordova-plugin-insomnia
- cordova插件添加 https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
- 科尔多瓦准备
- cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
- cordova prepare
然后在我写的index.js中:
Then in index.js i wrote :
if (window.plugins.insomnia && window.plugins.insomnia.keepAwake) {
window.plugins.insomnia.keepAwake(onSuccess,onError);
} else {
alert("insomnia plugin missing");
}
onSuccess已正确调用并执行.所以我认为安装正确.
onSuccess is correctly invoked and executed. So i assumed the installation is correct.
但是运行Android 5.1.1的我的Samsung Galaxy XCover 3的屏幕会在几秒钟后进入休眠状态.科尔多瓦6.3.1
But the screen of my SamSung Galaxy XCover 3 running on Android 5.1.1 sleeps after few seconds. Cordova 6.3.1
您有什么想法吗?
谢谢
推荐答案
类似于问题github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/issues/29 我不再使用失眠症了.
Similar to the issue github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/issues/29 I do not use Insomnia anymore.
这篇关于科尔多瓦-插件失眠不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!