GameKit keeping connection going while device screen off or in background

蓝咒 提交于 2019-11-29 12:43:49

This is not intentionally supported by Apple.

If you are writing this for an application that doesn't have to be distributed through the App Store, you can set the application up to play a silent audio file in the background. This will allow GameKit to continue to work even when your application has been put into the background or if the screen has locked.

If this application has to be distributed through the App Store, Apple require the audio to be a real feature, with audible music playing.

If you have two devices connected using GKSession and then one of them is interrupted by call or goes into background, when it wakes up connection should be still alive (you should be able to send/receive packets between devices).

You may try setting

UIRequiresPersistentWiFi

in your plist.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!