[英]BlueTooth Low Energy iOS App
I am connecting mac as a "Centerl" with my iPhone as a "Peripheral" using BlueTooth Low Energy.Both Peripheral and central connected successfully and work in both mode foreground and background. 我使用蓝牙低功耗技术将Mac作为“ Centerl”与iPhone作为“ Peripheral”进行连接。外围设备和中央设备均已成功连接,并且可以在前景模式和背景模式下工作。
But my problem is that during background mode,if i manually on or off the bluetooth of my device, i dectected my blue tooth is off or on during background mode , but Central not connected with peripheral anymore during background mode. 但是我的问题是,在后台模式下,如果我手动打开或关闭设备的蓝牙,我确定在后台模式下蓝牙处于关闭或打开状态,但是Central在后台模式下不再与外围设备连接。
You need to enable Background Modes for location update and for bluetooth low energy for your project target. 您需要为项目目标启用“ 背景模式”以进行位置更新和低功耗蓝牙。
Select Xcode project properties >> project target >> Go to Capabilities >> Background Modes 选择Xcode项目属性>>项目目标>>转到功能>>后台模式
As shown in above image check mark below properties: 如上图所示,选中以下属性:
Edit: 编辑:
Check device settings: 检查设备设置:
If all above is enabled, but still not working, Try to reset the network settings in Settings -> General -> Reset or reboot the device. 如果以上所有功能均已启用,但仍不起作用,请尝试在“设置”->“常规”->“重置或重启设备”中重置网络设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.