CBPeripheral unable to discover services on iPhone7 and iPhone7+
| Originator: | alxknt | ||
| Number: | rdar://28652602 | Date Originated: | 6/10/2016 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Our app uses iPhone in BLE Central role and connects to a remote device (an Android 5+ device) in Peripheral role. Our code works great on every combination of iOS 8.1 - 10.0.2 and iPhone 4S - 6S that we have tried, but fails with the iPhone 7 and 7+. After successfully discovering, connecting to the peripheral and retaining a reference to it, we call -discoverServices on the CBPeripheral, but the corresponding CBPeripheralDelegate didDiscoverServices method is never called (yes i triple checked the delegate property is set 😇)… eventually after 30sec the didDisconnect delegate method is called with error 0 "Unknown Error". The specific hardware combination that fails is: iPhone 7 iOS 10.0, 10.0.1, 10.0.2 and iPhone7+ 10.0.1 in Central role. Connecting to any Android device in Peripheral mode, except the Samsung S6 Edge. We have tested: iPhone 4S, 5, 5S, 6, 6+, 6S with various versions of iOS from 8.1 through 10.0.2, and these have all happily connected to a wide variety of Android 5.0+ devices. We typically call -discoverServices with our expected ServiceUUID. I have tried setting this to nil, but it made no difference. I have tried checking before calling discoverServices if the .services property on the CBPeripheral is already populated… it's not. I have raised the issue in the developer forums: https://forums.developer.apple.com/thread/63815 I believe this report is a duplicate of: rdar://28479978 https://openradar.appspot.com/28479978 Steps to Reproduce: In code: import CoreBluetooth 1. CBCentralManager -scanForPeripheralsWithServices:nil options:nil 2. wait for delegate -centralManager:didDiscoverPeripheral: to be called, retain the CBPeripheral 3. -connectPeripheral:options: 4. wait for delegate -didConnectPeripheral: to be called 5. -discoverServices: 6. … Expected Results: Delegate method -didDiscoverServices: should be called with the discovered services. Actual Results: With the combination of iPhone 7 and 7+ and any Android device we tested except the Samsung S6 Edge, -didDiscoverServices: is never called. Rather delegate method -didDisconnectPeripheral:error: gets called after 30sec with Error 0 Unknown Error. On any other iPhone I've tried, down to a iPhone 4S, -didDiscoverServices: is called promptly. Version: iPhone 7, 10.0.0, 10.0.1, 10.0.2. iPhone 7+ 10.0.1. Xcode 7.3.1, Swift 2.2, OSX 10.11.6 Notes: Android devices we have tested in Peripheral role: Samsung Galaxy S7 Android 6.0.1 Samsung Note 4 Android 6.0.1 Cyanogen OnePlus One Android 6.0.1 LG G5 Android 6.0.1 Sony Xperia Z1 Android 5.0.2 Samsung Galaxy S5 Android 5.0 Nexus 6 Android 6.0.1 Samsung S6 Edge Configuration: iPhone 7 and 7+ purchased in Sweden, unlocked. Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!