科尔多瓦-插件失眠不起作用 [英] cordova-plugin-insomnia not working

查看:65
本文介绍了科尔多瓦-插件失眠不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此处写的说明进行操作: https://www.npmjs.com/package/cordova-plugin-失眠

I follow the instructions written there: https://www.npmjs.com/package/cordova-plugin-insomnia

  1. cordova插件添加 https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
  2. 科尔多瓦准备
  1. cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆