Hey all, first message here, so I hope I don't sound too newbie.
I've been looking at the documentation to have my app discover peripherals while on the background and I think I have it all set up correctly.
1) I wait until the CBCentralManager's state is CBCentralManagerStatePoweredOn before I start scanning.
2) On scanForPeripheralsWithServices I pass an array of UUIDs with the services. NOT scanning with nil as that doesn't work in the background.
3) I have bluetooth-central inside UIBackgroundModes in my plist
With all these, eveything works great in the foreground, plus it works great if I discover the peripheral in the foreground and then go to the background. But if I go to the background before discovering the peripheral, it is never discovered.
UNLESS
I go to my phone Settings and open the BlueTooth page. Without even touching anything else, centralManager:didDiscoverPeripheral is called on my app as expected.
This surprised me, but at least gave me something solid to come and ask here.
Is there something I'm missing?
I'm running iOS 9.1. Couldn't test on 8.x yet to see if it is a new thing.
Thanks!
______
Jan Lübeck
Chief Technology Officer
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden