Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8 CoreBluetooth deprecated RSSI methods

So from reading the CBPeripheralDelegate documentation, it appears that RSSI and peripheralDidUpdateRSSI:error: were deprecated with iOS 8.

Xcode warning:

'rssi' was deprecated in iOS 8.0

I noticed that my signal strength indicator was no longer being updated, so I did some research and found a new method ([CBPeripheralDelegate peripheral:didReadRSSI:error:]) that supposedly get called back asynchronously after calling the readRSSI method. Unfortunately, this method does not seem to get called back either, even though I did set the parent class as the CBPeripheral delegate.

Has anyone else had issues with the iOS 8 CoreBluetooth updates?

like image 246
user1927638 Avatar asked Sep 20 '14 18:09

user1927638


2 Answers

There is a known issue that has been posted about this on the Apple Developer forums to which I have an open radar as well.

The issue seems to be that the new callback method peripheral:didReadRSSI:error: is never called on iOS 8 specifically after the initial connection is made to a peripheral. The only resolution I have found is to reset bluetooth on your phone by turning it on/off or restarting the phone.

Here is the link to open radar I filed.

UPDATE:

Just tested my example that was displaying this issue with the current 8.2 release and I am no longer seeing any issues with the new iOS 8 delegate method never being called. I am marking my radar as resolved per the 8.2 release.

like image 184
Robert Haworth Avatar answered Oct 09 '22 07:10

Robert Haworth


In iOS 8.1.1, peripheral:didReadRSSI:error: will only get called for peripherals that you are connected to. If you've merely discovered the peripherals with a scan and then called readRSSI on them, the callback will not be called.

Try connecting to the peripheral first (via CBCentralManager's connectPeripheral:options:), and then calling readRSSI.

like image 28
David Shoemaker Avatar answered Oct 09 '22 07:10

David Shoemaker