您可以防止在屏幕锁定或屏幕锁定期间关闭Wifi吗? [英] can you prevent Wifi from shutting off during screen lock or screen lock?

查看:98
本文介绍了您可以防止在屏幕锁定或屏幕锁定期间关闭Wifi吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,可通过网址通过网络摄像头在os x上创建定时电影。最近,我有很多用户抱怨录音下降了很多帧。当屏幕锁定时,我已经将问题隔离到优胜美地断开wifi的连接。有没有办法让系统知道您的应用保持网络连接很重要?告诉用户进入并禁用屏幕锁定只是为了使用我的应用程序很烦人。

I have an app that creates time lapse movies on os x from webcams available through a url. Recently I have had lots of users complaining that the recordings are dropping tons of frames. I have isolated the problem to Yosemite disconnecting the wifi when the screen locks. Is there a way to let the system know that it is important that your app keeps the network connection? It is annoying to tell the users to go in and disable screen locking just to use my app.

推荐答案

如果有Wi-Fi真的关闭了,听起来像是苹果的虫子

If the Wi-Fi is really turning off, that sounds like an Apple bug.

您可以禁用 App Nap &通过注册活动

You can disable App Nap & idle sleep by registering an "activity".

NSActivityUserInitiated 选项应该足够

还有 NSActivityIdleDisplaySleepDisabled

这篇关于您可以防止在屏幕锁定或屏幕锁定期间关闭Wifi吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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