iOS 10 Background Bluetooth Discoverability
| Originator: | felix.dumit | ||
| Number: | rdar://29653172 | Date Originated: | 12/13/16 |
| Status: | Open | Resolved: | |
| Product: | iOS + SDK | Product Version: | 10.2 |
| Classification: | Serious Bug | Reproducible: | ALWAYS |
Summary: A device in iOS 10 advertising a Bluetooth service, is not discovered by devices searching for that specific service after the app is moved to the background, even with the "bluetooth-peripheral" background mode capability. This issue if only being manifested while the screen is unlocked, as after a few seconds that the screen is locked the device becomes discoverable again. Steps to Reproduce: I have attached a sample project, you can also download it here: https://github.com/felix-dumit/BluetoothTest You will need 2 devices to test these issue, let's call them device A and device B. For this issue to be reproduced device B needs to have iOS 10, device A version does not matter. (Also it is useful to test with device B being iOS 9 or lower as the issue does not occur.) 1) Open app on both devices 2) On device A select "Scan" then "start". 3) On device B select "Advertise" then "start" (Accept the permission) 4) Hit stop on device A, this will cause the list of discovered devices to show on screen - it should include device B. 5) Hit the home button on device B 6) On device A, hit "start" then "stop" after a few seconds - device B should no longer appear (THIS IS THE BUG!!!) 7) Lock device B 8) Wait a few seconds and hit start/stop again on device A, device B will now be discoverable again. If you lock the screen with the app open it continues being discoverable, so the issue is only the device is unlocked and the app is in the background it is not discoverable. I have noticed the Bluetooth behavior changed quite a bit over the iOS 10 betas and full release, since at first it would not work at all with the app in the background, but now the issue seems to be limited to the screen unlocked. Anyway, I'd like to know if I'm missing something in my implementation, as the exact same code works fine on iOS <=9, or if this is a bug with the current iOS version ( I am testing on the latest 10.2)
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!