I'm developing a iOS application which works as BLE Central. I want to relaunch the application, even after its termination, if it detects peripheral devices.
I created my central manager according to the Apple's programming guide in section "Performing Long-Term Actions in the Background". https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html#//apple_ref/doc/uid/TP40013257-CH7-SW1
But the app. relaunches only in particular condition.
In this case, my app relaunch ([application didFinishLaunchWithOption] and [central willRestoreState] is called) after peripheral device start advertising.
In the situations like below my app doesn't relaunch even after peripheral device start advertising.
I'm creating and initiating my central manager normally.
NSDictionary *options = @{
CBCentralManagerOptionRestoreIdentifierKey : kBlitCentralMgrRestoreIdKey,
CBCentralManagerOptionShowPowerAlertKey : @YES,
};
self.centralMgr = [[[CBCentralManager alloc] initWithDelegate:self queue:nil options:options] autorelease];
If you have any idea to resolve the issue, please let me know. I appreciate you kind cooperation.
If you swipe the app from the App Switcher to kill it, the OS will not relaunch it. This is the same case with apps that rely on Background App Refresh.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.