Hi everyone,
I am trying to wake up/relaunch an app that was force-quit by the user via a BLE advertisement packet.
According to TN3115 ("App Force Quit by the user" section), an app generally cannot be woken up after a user force-quit. However, Note 5 states that starting in iOS 26, an app authorized via AccessorySetupKit can indeed be relaunched.
Environment
- iOS Version: iOS 26.5 (Note: revised to standard versioning)
- Xcode Version: Xcode 26.3
Implementation Details
1. Info.plist Configuration
<key>NSBluetoothAlwaysUsageDescription</key>
<string>We need Bluetooth to discover and connect to your accessory.</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
</array>
<key>NSAccessorySetupKitSupports</key>
<array>
<string>Bluetooth</string>
</array>
<key>NSAccessorySetupBluetoothServices</key>
<array>
<string>0000XXXX-0000-1000-8000-00805F9B34FB</string>
</array>
<key>NSAccessorySetupBluetoothNames</key>
<array>
<string>MyDeviceName</string>
</array>
2. Workflow & Code Steps
- Initialize
ASAccessorySessionand callactivate(). - Pair/authorize the BLE peripheral using
ASPickerDisplayItem. - Initialize
CBCentralManagerwith state restoration:
let options: [String: Any] = [
CBCentralManagerOptionRestoreIdentifierKey: restoreIdentifier,
CBCentralManagerOptionShowPowerAlertKey: true
]
centralManager = CBCentralManager(delegate: self, queue: nil, options: options)
- Start scanning:
let scanOptions = [CBCentralManagerScanOptionAllowDuplicatesKey: true]
centralManager?.scanForPeripherals(withServices: serviceUUIDs, options: scanOptions)
- Handle state restoration:
func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) {
if let services = dict[CBCentralManagerRestoredStateScanServicesKey] as? [CBUUID],
let options = dict[CBCentralManagerRestoredStateScanOptionsKey] as? [String : Any] {
central.scanForPeripherals(withServices: services, options: options)
}
}
- Receive discovery callback:
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
if peripheral.name == "MyDeviceName" {
// Send a local notification
}
}
Current Behavior
- Foreground: Local notification triggers as expected.
- Background: Local notification triggers as expected.
- Force Quit by User: No notification is received / App is not relaunched.
Issue
The app fails to relaunch when force-quit by the user, which seems to contradict the behavior described in TN3115 Note 5.
Is there a specific configuration, entitlement, or additional CBCentralManager setup required to allow BLE advertisements to relaunch the app after a user force-quit via AccessorySetupKit?
Any guidance would be greatly appreciated!