0

I'm in the process of developing an iOS app that uses iBeacons. I understand that my app can get woken up to the background when an enter event is triggered (when the iPhone detects a iBeacon with a certain UUID). Can I use this to send back a beacon signal myself? (All while the phone is locked)

I know that my app would only have a few seconds in the background after being woken up by the enter event, but normally this should be enough time to send a beacon signal.

Any help is highly appreciated. Thanks in advance.

Philipp
  • 25
  • 1
  • 4

1 Answers1

0

Unfortunately, an iOS device cannot send a standard iBeacon transmission when in the background. While you can execute the code to do so, and iOS will transmit, background transmissions will.not be detectable as iBeacons by other devices.

Why? CoreBluetooth uses a proprietary technique to roll up all Bluetooth advertisements of background applications into a single advertisement. This is designed to work with advertising Gatt services, and it has the side effect of breaking the iBeacon format.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • Okay thanks for the answer. From your answer I understand that it is possible to send out something via Bluetooth even though it won't be in the iBeacon format. This would mean that I would be able to detect that message anyway, right? – Philipp Jul 12 '17 at 16:02
  • Yes, you can detect that message using CoreBluetooth. But I don't think you'll find it very useful, as it won't contain any information that you can use to identify it as coming from another phone. See my answer here: https://stackoverflow.com/a/34225768/1461050 – davidgyoung Jul 12 '17 at 16:15
  • Actually I planned on detecting the answer from the phone with a Raspberry Pi. So would it be possible to send back a message containing some identifier and then some sort of payload and understand that with the Pi? (e.g. "1234567890 - 'Understood'") All this would be a way around of having to actually connecting the phone and the raspberry because I think that is not possible while the phone stays in the pocket. Please correct me if thats false or if you have any idea on how to achieve this. Thank you very much – Philipp Jul 12 '17 at 16:43
  • A good solution to do this is to use the custom background beacon advertising framework provided by these guys: https://github.com/Decemberlabs/AltBeacon It is not a standard iBeacon (or even an open-source AltBeacon format despite using the same name) but it is a format you should be able to transmit in the background and detect on another device like a Raspberry Pi. – davidgyoung Jul 12 '17 at 16:58