I have a beacon with the most recent firmware (2.0). I'm able to connect to it normally if the app is in foreground, but I would like to do the same if the app is in background and still running.
When in background, I get this error: Could not connect to:<ESTBeacon: 0x18062b80> - Error:Device not in range or has outdated firmware
The beacon is as close as possible to the device and the firmware is not outdated. I connect normally if the app is on the screen.
I've tried adding the "uses bluetooth LE accessory communication" and "act as a bluetooth LE accessory" background modes to my app, but it didn't have any effect on the issue.
Does anyone know if this is a known and intentional limitation of the SDK or is it a bug/issue?
I have an answer from our developers. We don't use connecting with beacon in background. In general it is possible but you would have to keep reference to this beacon.
You can connect only in foreground (where you already ranged selected beacon), because ranging does not work in background - but connecting does! So that's why you are out of range. You could try starting connection (when you have reference to beacon and ranged it already) and see what will happen, but not range it in background.
Thank you very much for the feedback. The solution you said is perfect since I don’t need to range, only connect. For some reason, it still shows the same 402 error (Device not in range or has outdated firmware).
With the app in foreground, I range, select the ESTBeacon, connect for the first time and then disconnect - Works fine!
I minimize the app
I try to connect again without ranging (I keep the ESTBeacon reference from the first connection), but It shows the same error after a 10 or 20 secs.
Bring the app to foreground again, try step n.3 and it works
I tried it a few times to make sure it is not a distance or interference problem.
I also tried with different beacons, but can’t manage to make it work :-(