iPhone 7 - CBPeripheral -discoverServices fails to callback

Hi all,


We're developing an app which involves BTLE communication between Android and iOS.

We have Android5.0+ in Peripheral mode and iOS in Central.

We've been developing this for a few months, I've been testing the iOS side on phones from 4S to 6S from iOS8.1 to the iOS10.0.1 release. All was good.


This week we got our first iPhone 7. It's lovely, but to my horror, we're unable to complete our data transfer to the Android BTLE Peripherals. After scanning and successfully connecting to the peripheral we set the delegate and call -discoverServices as normal but the delegate method never gets called back.

I tested both iOS10.0 14A346 (that it shipped with) and current 10.0.1 14A403.


My didConnectPeripheral implementation looks like:


func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) {
    DLog("Connected: \(peripheral)")
    self.lastPeripheral = peripheral
    if peripheral.services == nil {
        peripheral.discoverServices([lockServiceUUIDBase])
        assert(peripheral.delegate != nil)
    } else {
        DLog("Services already exist, shortcutting")
        self.peripheral(peripheral, didDiscoverServices: nil)
    }
}


Nothing too fancy. This method gets called, the assert doesn't throw, but -didDiscoverServices never gets called. I have tried removing the specific service UUID's but it made no difference.


Has anyone else run into this?


Thanks in advance.

Alex Kent

Answered by thomas_c in 192092022

After updating my iPhone 7 to iOS 10.1, the problems are solved. didDiscoverServices is now called and I can access the peripheral.

Hi guys,


Is anyone facing same issue with iOS 10.1.1 ? On iOS 10.1, and even earlier 9.3 everything was working good, but on 10.1.1 I am facing this problem now. Any solutions?


Thanks!

Hi, if you are still having issues with this, please write me an email, (same as my user name, yahoo mail). I can try and help you the best I can. Our app went live with my hack.

Hi moni_qwerty,

I'm developing an app for a BLE smart device, (iPhone is Central and a BLE device is Peripheral) just like you did. Now I've facing the same problem as you. My app works perfectly on iPhone 6S and phones before, but when connecting to the Peripheral device by iPhone 7/8/X, it always time out and cannot get services. BTW, all my phones runs on iOS 11.May I know how did you solve this problem? I'd relly appreciate it if you can give me some clues.

Thanks!

Blake

Hi moni_qwerty,

I'm developing an app for a BLE smart device, (iPhone is Central and a BLE device is Peripheral) just like you did. Now I've facing the same problem as you. My app works perfectly on iPhone 6S and phones before, but when connecting to the Peripheral device by iPhone 7/8/X, it always time out and cannot get services. BTW, all my phones runs on iOS 14.4.May I know how did you solve this problem? I'd relly appreciate it if you can give me some clues. My email is imran.khan@safectory.com.
Thanks!
Imran
iPhone 7 - CBPeripheral -discoverServices fails to callback
 
 
Q