You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.2 KiB
1.2 KiB
iOS蓝牙配置说明
所需权限
要在iOS中使用经典蓝牙功能,需要在应用的Info.plist中添加以下配置:
1. 外部附件协议支持
在Info.plist中添加UISupportedExternalAccessoryProtocols数组,并添加你的设备支持的协议。如果不确定,可以先添加常见的协议:
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.example.protocol</string>
<!-- 添加其他你设备支持的协议 -->
</array>
2. 蓝牙使用说明
在iOS 13及以上版本中,需要添加蓝牙使用说明:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>我们需要使用蓝牙来连接您的音频设备</string>
对于iOS 13以下版本:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>我们需要使用蓝牙来连接您的音频设备</string>
常见问题
-
如果看不到任何设备,请确保:
- 设备已配对并连接到iOS设备
- 设备是MFi认证的(Made for iPhone/iPad),因为iOS对经典蓝牙有限制
- 添加了正确的协议字符串
-
蓝牙状态变化不及时:
- iOS系统对蓝牙状态变化的通知可能有延迟
- 请确保用户已经授权蓝牙权限