Reputation: 691
I'm trying to search if it is possible for iPhone to scan BLE device and read its advertisementData while it is in sleep mode.
For example, continuous scanning as long as it takes and then if a device changes its advertisementData the phone will wake up and fire a local notification. Meaning, the app is running in background mode for x period of time.
Is it possible? Because in android it is.
Upvotes: 1
Views: 1042
Reputation: 114846
There are restrictions on peripheral scanning when your app is running in the background:
nil
As the duplicates key is ignored in the background, if a peripheral has previously been discovered by your app then its discovery will not re-trigger the didDiscoverPeripheral
delegate method until your app is re-started.
For long-term discovery you should also opt-in to state-restoration but that isn't needed for a simple test-case running under Xcode.
Upvotes: 2