Listening BT advertisements in the background

We are currently developing an iOS application that involves BT communication between iPhones and multiple peripheral devices (listening for advertisement messages). The application will be published to App Store.


In iOS (for iPhone) it doesn’t seem to be possible to listen for Bluetooth advertisement messages (beacons) when the application is not in foreground. This seems only to be possible in background when using BT peripheral mode (i.e. connecting to the peripheral device) but it does not work when a PIN code is required for pairing, which is our case.


Q1: How to be able to listen for beacons in background mode without peripheral connection and be able to publish the application to App Store? A few workaround for background app functionality seem to exist but that limits the possibility of publishing to App Store.


Q2: How to programmatically set a PIN code for a peripheral connection in iOS, i.e. without requiring user interaction when pairing multiple times and devices? If not possible directly is there any work-around or upcoming feature on the iOS development roadmap?