-2

I've got a beacon ranging app that previously was working fine in both foreground and background for extended periods of time (days). Now recently it will suddenly stop showing any beacons even in foreground. Typically, it will work fine for 18 to 20 minutes, then stop and show my beacons being ranged with a value of 0 RSSI (viewing using debug messages in xcode log window), even though the beacons are only feet away and previously registering RSSI values of -60. After a few seconds, it will continue to fire the didRangeBeacons event every second but with an empty array of beacons.

I saw another thread here about iOS 12.1 having a bug causing ranging to stop in the background and that 12.2 beta 2 had a fix, so I updated the iPad I'm using for testing from 12.1 to 12.2 beta 4 but still having the issue.

When the device gets into this state, I can stop the app and re-run it and it will work again for about 20 minutes:

OR

I can switch to the settings screen on the iPad while my app is still running and watching my messages in xCode. As soon as I open the settings screen, I can see the debug messages immediately start showing beacons again. I can switch back to my app and it will continue to work for around 20 minutes, then fail again.

I do have CLLocationManager pausesLocationUpdatesAutomatically set to false.

It almost sounds like the Bluetooth is shutting off, but it is very perplexing.

UPDATE:

I have seen that the app will continue to work for hours in the background if the screen is turned off / locked. It only stops working if the screen is on, either in foreground or background.

I have tried resetting the test iPad and also resetting network settings and location permissions with no change in observed performance.

This looks like the same sort of situation that happened when Apple first released iOS 10, and broke beacon ranging.

UPDATE 2:

Checking for the following CLLocationManager events, and none of them are being triggered when ranging stops:

didFailWithError

rangingBeaconsDidFailForRegion

locationManagerDidPauseLocationUpdates

didExitRegion

didChangeAuthorizationStatus

Also, running gpx file in a loop to simulate location changing doesn't change the observed bug.

RobertT
  • 77
  • 8

1 Answers1

0

Have found that this problem appears to be hardware related. Testing on an iPad Mini has the problem, while testing on an iPhone XS does not (Both using OS 12.2).

And, oddly enough, using iBeacons from a different manufacturer (but with identical advertisement settings) would also fix the issue. In that case using the iPad or the phone would work.

RobertT
  • 77
  • 8