流星 – 如何保持手机屏幕

流星 – 如何保持手机屏幕,第1张

概述我正在研究一个运行很长时间的Meteor应用程序,我正在寻找一种在没有用户活动时保持屏幕的方法(当然应用程序在运行时). 谢谢 如果我正确阅读了 documentation,而我可能没有,因为我以前从未使用过这个,那么你可以将 insomnia plugin添加到你的cordova / phonegap版本中,如下所示: $meteor add cordova:nl.x-services.plug 我正在研究一个运行很长时间的Meteor应用程序,我正在寻找一种在没有用户活动时保持屏幕的方法(当然应用程序在运行时).

谢谢

解决方法 如果我正确阅读了 documentation,而我可能没有,因为我以前从未使用过这个,那么你可以将 insomnia plugin添加到你的cordova / phonegap版本中,如下所示:

$meteor add cordova:nl.x-services.plugins.insomnia@https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/tarball/47ba15a4ad791eb4d5a0643cdb7ef69f73109e15

然后使用:

window.plugins.insomnia.keepAwake()

window.plugins.insomnia.allowSleepAgain()

Meteor 1.2更新:

Install plugins from a Git URL: Meteor no longer supports installing Cordova plugins from tarball URLs,but does support Git
URLs with a SHA reference (like
07003).
Existing GitHub tarball URLs are converted automatically.

这意味着您现在需要使用:

$meteor add cordova:nl.x-services.plugins.insomnia@https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin#47ba15a4ad791eb4d5a0643cdb7ef69f73109e15

更新2

正如user3819370指出的那样,该插件现在位于meteor使用的注册表中,因此您可以像这样安装它:

meteor add cordova:[email protected]
总结

以上是内存溢出为你收集整理的流星 – 如何保持手机屏幕全部内容,希望文章能够帮你解决流星 – 如何保持手机屏幕所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1000697.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存