iOS 10 - Bluetooth Stops Advertising When Screen is Locked

Hi,


We have an app that advertises in the background and being able to persistently advertise in the background is a core feature of our app.. We've noticed as of the public iOS 10 beta (could be older) that our app, and seemingly every other advertising app, stops advertising when the phone is locked. Is this intentional, a bug or something that we have to request additional permission from the user to do in iOS 10?


If it is a bug, I am happy to file a radar. I just wanted to find some clarification on whether or not this is the case.

Replies

As a first step, please always file bug reports against any issues you see in beta seeds. https://bugreport.apple.com

Even if a change in behavior is intentional, filing bug reports helps the engineering teams to understand pain points and take appropriate action if necessary.


When an advertising app is no longer in the foreground, several things happen as necessary. The advertising rate will slow down, and any advertised services will be moved to an overflow area. As documented, advertising while the app is not active is done on a best effort basis. Foreground apps and certain system services will take precedence when it comes to using the shared Bluetooth resources. So, depending on the situation at the moment you may find that your advertising rate is slower than other times, or not happening at all.


This behavior is not new to iOS 10. The difference you have noticed may be caused by the difference between the specific devices (based on what they are paired with, what apps are on them, etc.) rather than iOS versions.


Either way, please do file a bug report if you have noticed a change in behavior in iOS 10 betas vs. shipping versions.

We noticed the same thing in our tests with iOS 10 beta. Even worse, in our case the phone stops advertising altogether as soon as the app moves to the background. It's not the case that the advertising rate slows down, it will simply just stop advertising.

The only thing that is new in the permissions in iOS 10 is that the Info.plist key "NSBluetoothPeripheralUsageDescription" is now required. But even with that included, it did not make a difference.

Bug report is filed, lets hope it will be fixed in the next beta version!

I've also seen exact same behavior as yours on a iPhone 5s using iOS 10 beta3, on beta 2 it seemed still can broadcast in background, so very likely it's a regression.

Thanks for the reply Gualtier. Will file a radar this week.


As stated in my post. It's not a slow down of advertisements, it's a complete halt to any adveristing of our app or any other app on the device. Our product can handle slow downs in advertisements, but we do need the ability to always advertise in the background (or at the very least use the restore advertisements that iOS core handles on behalf of our app).


If you have any additional information or things that we should try, happy to do that. Either way, I will file a radar and see where we get.


Thanks again.

Beta 4 was out today, just tested, background advertising still not working, the OS permission dialog would pop up, but after brought the peripheral app to background, the scanner which explicitly scanned for it cannot find it anymore, using LightBlue can see this device, but with "No services" label under the "Unnamed" device name label.

Using Light Blue, I could see the advertising completely shut off after about 3 minutes in black screen mode, if I unlocked the screen, Light Blue can discover the peripheral again, but still with label: "No Services".


Can you confirm that the BTServer throws an error in the device log when the app moves to the background?

<Error>: Failed to start advertising with result 101

Can you post your bug id?

Sure, Bug ID is 27493422 - please reference it in your bug reports as well. State of the issue is still "open" and unranked...

I've checked the system console, but didn't see such error.

Hi, Emimh, is the issue you logged marked fixed already? If not, could you share with us about the lad test status? Big thanks!

Unfortunately, the bug report is still open. I guess no one at apple looked at it yet.


Worse even, the GM seed still has the bug. So there is little hope of this issue getting fixed before the public release next week. Seems as apple does not care they will break many use cases and in the end products of real companies that people depend upon.

Hi Emimh,


Thanks for letting me know : ], yes it's already GM and not likely they gonna fix it in the next week's release, but since it's still open, wish they will fix it in a later patch.🙂

We have the exact same results here with the GM and iOS 10 Beta 8. Submitted a bug report and referenced emimh's bug 27493422.


If anyone makes any progress please respond back.

In iOS 10 GM background bluetooth LE advertising does not work. Bluetooth Sharing setting in Settings app does absolutely nothing! We have spent last 6 months building a brand new bluetooth chat app which was due to be released next week and it doesn't work without background advertising. Can anyone from Apple clarify if this going to be fixed at all or we can drop the app development altogether?


P.S. I have filed a bug it's 28208080.

Any update on your ticket? GM is out and this issue still isn't resolved... Are they aware of this issue?