I am using Bluetooth LE on iPhone 5S and I have done the following:
I have a bluetooth peripheral and I have configured it to advertise each 20th ms on all three bluetooth advertising channels (37, 38 and 39).
I have configured my app with UIBacgroundModes = bluetooth-central in Info.plist
I have started a scanForPeripheralsWithServices like below
Code:
NSDictionary *options = @{
CBCentralManagerOptionRestoreIdentifierKey:@"myCentralManagerIdentifier",
CBCentralManagerScanOptionAllowDuplicatesKey:[NSNumber numberWithBool:YES]
};
self.manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:options];
[self.manager scanForPeripheralsWithServices:[NSArray arrayWithObject:[CBUUID UUIDWithString:@"<uuid removed>"]] options:options];
The current state is:
In foreground mode the app quickly receives advertisement messages when I start my peripheral (within one second)
In background mode the app sometimes receives advertisement messages within like 10 seconds after starting the peripheral (which can be acceptable even if it is bad) however often it does not receive the advertisement for a very long time (minutes or more) and this does not work for the application.
Question is:
Is it in some way possible to increase the rate of which iOS is scanning for Bluetooth 4.0 LE peripherals when the scanning app is in background? Since I don't think there is a public API to do this, I am looking for a private API that is not published by Apple. This is for an internal enterprise app so a private API would be perfectly OK.