1
votes

Hi I am looking to see if I can send a notification when my iPhone connects to a bluetooth device with my app running in the background. This is similar to what happens with an iBeacon in iOS 7 I am just wondering if this can be done with any bluetooth device. I am ok with using private API's if necessary. If I understand bluetooth correctly, any bluetooth device has to at least communicate its identifier and wait and receive pairing codes so I am hoping i can be able to determine that if a bluetooth device broadcasts an identifier and my phone connects to it then send a notification like an iBeacon.

I have used an Estimote and it can broadcast the proximity and send notifications accordingly, I just want to be able to send a notification when a bluetooth connection has been made from any bluetooth device.

Thank you

1

1 Answers

1
votes

On Apple's documentation you can find that you can act as a Bluetooth Central in the background. You should get callbacks if you are scanning for the correct UUID.

I haven't tested this but check that you have the correct UIBackgroundMode key in the info.plist file.

Also your CBCentralManagerDelegate should call the selector centralManager:didDiscoverPeripheral:advertisementData:RSSI: while your app is in the background.