Re-connect bluetooth device when app is terminated by user

不羁的心 提交于 2019-11-29 14:36:41

You need to enable and program you App to handle Core-Bluetooth Background Mode

this way you will be able to reconnect to the device if your App is killed by the OS to free some resources.

"Even if your app supports one or both of the Core Bluetooth background execution modes, it can’t run forever. At some point, the system may need to terminate your app to free up memory for the current foreground app—causing any active or pending connections to be lost, for instance. As of iOS 7, Core Bluetooth supports saving state information for central and peripheral manager objects and restoring that state at app launch time. You can use this feature to support long-term actions involving Bluetooth devices"

but you cannot reconnect if the user has terminated your App.

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