Android 12 设备使用 API 33 时未收到 BLE 通知

问题描述 投票:0回答:0

新版本的蓝牙API将阻止旧版本设备(如Android 12设备)接收通知,但旧API可以正常工作。

public void onCharacteristicChanged (BluetoothGatt gatt, 
            BluetoothGattCharacteristic characteristic, 
            byte[] value) {
        }

API 33,在 Android 13 上运行良好,在 Android 12 上不起作用。

        override fun onCharacteristicChanged(gatt: BluetoothGatt,
            characteristic: BluetoothGattCharacteristic
        ) {
        }

旧版本,在 Android 13 和 12 上运行良好。

有没有办法在使用新版本API的同时,让Android 12以下的设备正常工作?

android notifications bluetooth-lowenergy
© www.soinside.com 2019 - 2024. All rights reserved.