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.
liwei1dao eaeae8583e 上传苹果正在使用的经典蓝牙 1 year ago
..
Classes 上传苹果正在使用的经典蓝牙 1 year ago
README.md add 1 year ago
classic_bluetooth.podspec 向下兼容16版本 1 year ago

README.md

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>

常见问题

  1. 如果看不到任何设备,请确保:

    • 设备已配对并连接到iOS设备
    • 设备是MFi认证的(Made for iPhone/iPad),因为iOS对经典蓝牙有限制
    • 添加了正确的协议字符串
  2. 蓝牙状态变化不及时:

    • iOS系统对蓝牙状态变化的通知可能有延迟
    • 请确保用户已经授权蓝牙权限