gpt4 book ai didi

iphone - 用户不活动一段时间后 WiFi 连接会断开

转载 作者:行者123 更新时间:2023-12-03 19:38:23 26 4
gpt4 key购买 nike

我的 iPhone 应用程序通过 wifi 与远程服务器建立 TCP 连接。但是,如果一段时间内没有用户事件,设备将关闭 wifi 并断开连接。有可能预防吗?我需要在应用程序运行时保持连接持久。设置 setIdleTimerDisabled:YES 没有帮助 - 它可以防止屏幕关闭,但 wifi 仍然关闭。

您知道这是否可行以及如何实现吗?

最佳答案

查看此网址: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/ApplicationEnvironment.html#//apple_ref/doc/uid/TP40007072-CH7-SW59

Table 1-3 Important keys in the Info.plist file

UIRequiresPersistentWiFi:

A Boolean value that notifies the system that the application uses the Wi-Fi network for communication. Applications that use Wi-Fi for any period of time must set this key to true; otherwise, after 30 minutes, the device shuts down Wi-Fi connections to save power. Setting this flag also lets the system know that it should display the network selection dialog when Wi-Fi is available but not currently being used. The default value is false.

关于iphone - 用户不活动一段时间后 WiFi 连接会断开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/761140/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com