Reputation: 24394
I'd like to detect when a bluetooth device or network disconnects, even when my app isn't running.
In Android, you can register to be notified when the bluetooth adapter changes state.
I don't need to bring the app to the foreground. I just need to record the fact that it disconnected, a timestamp, and some location data. Once the user brings the app back up, I'll be accessing that data to provide them info of where the bluetooth device disconnected.
(I'm using RubyMotion, but that isn't super relevant for this question. Objective-C answers are fine.)
Upvotes: 3
Views: 3175