1

Background

I have an iOS app which scans for BLE devices in the Background. It worked well until I updated to iOS12. This is what I have:

  1. App is configured to run in Background (e.g. location & bluetooth-central keys in .plist)
  2. App is supposed to run continuously in Background, scanning for Peripherals. This is not to be confused with Background Fetch, which is a different use case.
  3. App does not connect to Peripherals. It only reads the advertisement packets.
  4. App gets suspended after running for a few hours in the Background.
  5. App resumes normal operation when brought to the Foreground
  6. App operated properly in iOS 11. Problems started after updating to iOS 12.x

I placed log messages in the App Delegate methods. This last thing I see is the app entering Background State. I never see a call to applicationWillTerminate(), as it is only called when the app is in the Foreground.

I have seen other posts (e.g. iOS 12 terminates apps in the background for no reason) for similar behavior with the Location stack. Using the test app written by the author of the post, I verified the problem has been fixed in iOS 12 for Location Services. But the BLE problems persist.

Has anyone found a workaround for this problem?

thanks in advance.

Bassman
  • 353
  • 5
  • 17
  • Which service CBUUIDs are you scanning for? (What are you passing to scanForPeripherals?) Provided you're using the interface correctly, I expect you'll wind up doing the same thing the linked answer discusses, and open a defect at bugreport.apple.com to discuss it. – Rob Napier May 07 '19 at 13:28
  • 1
    @RobNapier I am scanning for "0xFDnn" which is a 16 bit UUID purchased by my firm. Thanks for the heads up. I will start the dance with Apple today.... – Bassman May 07 '19 at 13:50
  • Yeah, that sounds absolutely fine; likely a related to bug to the one you linked. – Rob Napier May 07 '19 at 13:53

0 Answers0