Q:

Making ios7 BLE peripheral to work in background

I have read every related information about it, but still can't make my iOS7 device work like peripheral advertiser in background. It works fine in foreground, but in background I can even discover it. I added App shares data using CoreBluetooth in plist file. I read that after going in background it puts my custom UUID in overflow data. I tried this one too(but no luck).  
NSDictionary *advertisingData = @{
 CBAdvertisementDataServiceUUIDsKey : @[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID],
 CBAdvertisementDataOverflowServiceUUIDsKey : @[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]
};  
[manager startAdvertising:advertisingData];

In the central from other side (MAC OS app), I am scanning only for my: TRANSFER_SERVICE_UUID service. Is there something that I have missed that I should implement additionally in the central side?

A:

Note this line from the startAdvertising: method's documentation:

While an application is in the background, the local name will not be used and all service UUIDs will be placed in the "overflow" area. However, applications that have not specified the "bluetooth-peripheral" background mode will not be able to advertise anything while in the background.

That is, the backgrounded peripheral removes every thing from the advertisement and only its presence can be detected by non iOS applications. iOS apps are able to reach the overflow area but MacOS apps can't. You need to turn off the service filtering on the MacOS side to be able to detect the peripheral and connect to it to discover if it has the searched service.
FYI, there is no workaround for this scenario, it has been discussed several times on the Apple bluetooth-dev mailing list and in many SO questions.
Also note that CBAdvertisementDataOverflowServiceUUIDsKey is not a valid input key for startAdvertising:. CBAdvertisementDataOverflowServiceUUIDsKey is returned by iOS in the didDiscoverPeripheral callback if it found something in the overflow area. Use only CBAdvertisementDataServiceUUIDsKey to define the list of advertised services.

