The Issue
iOS 18 CoreBluetooth – scanForPeripherals method with a defined CBUUID is not detecting iPhone peripherals advertising in the background state.
Setup
- iPhone A (peripheral) – Advertising a service with a specific CBUUID
myServiceUUID
- iPhone B (central) – Scanning using the method
sCentralManager.scanForPeripherals(withServices: [myServiceUUID])
Test Cases
- iPhone B (with iOS 18) – detects iPhone A in the foreground state (app open in the foreground)
- iPhone B (with iOS 18) – FAILS TO detect iPhone A in the background state (app in background; not terminated)
- iPhone B (with iOS 17 and below) – detects iPhone A in both foreground and background states
FYI
- iPhone A could be any version of iOS
- Test Case 2 is the ISSUE!