GameKit 在设备屏幕关闭或在后台时保持连接 [英] GameKit keeping connection going while device screen off or in background

查看:22
本文介绍了GameKit 在设备屏幕关闭或在后台时保持连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要蓝牙连接的应用程序,我使用 GameKit 进行数据传输,但是我看到当我进入后台模式时,或者我只是在应用程序中关闭屏幕时,蓝牙连接断开了... 我见过在这种情况下保持连接活跃的其他应用程序,有人知道我是否遗漏了不会导致连接在这种情况下断开的东西吗?一直在环顾四周,但没有发现任何有用的东西...

I am working on an appliction that requires bluetooth connectivity, which i use GameKit for data transfer, however im seeing that when i go in background mode, or I just turn off the screen in app, the bluetooth connection is dropped... Ive seen other apps that keep the connection alive in such situations, anyone have any idea if I am missing something that wont cause the connection to drop on such cases? Have been looking around but havent found anything useful...

谢谢

丹尼尔

推荐答案

这不是 Apple 有意支持的.

This is not intentionally supported by Apple.

如果您为不必通过 App Store 分发的应用程序编写此程序,您可以将应用程序设置为在后台播放无声音频文件.这将允许 GameKit 继续工作,即使您的应用程序已被置于后台或屏幕已锁定.

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.

如果必须通过 App Store 分发此应用程序,Apple 要求音频是真实的功能,并播放可听音乐.

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

这篇关于GameKit 在设备屏幕关闭或在后台时保持连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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