Bluetooth whilst in background state

I have core location running when the app is running in the background ie not active, the plan is that i can send tracking data through to our server (which I believe is more than fine to do) however and this is the key element to this post. I need some way that the user can trigger an event whilst the app is in the background state. This event could be anything, a shake of the device, changing the volume, anything like this.

So simply, is it possible to register the user doing any of the following whilst the app is in the background state:-

1. shake the phone?

2. detect a volume change, home button press, power button press?

3. detect a button press on a bluetooth device?

Also, is there anything else that may be possible?

Option 3 is possible, and would be the one I can recommend.

Through Bluetooth background modes, your app can connect to and listen for a notification from a Bluetooth 4 device (which can be triggered by a button press).

When this notification arrives, your app will be activated in the background for a short time for you to react as necessary.

Although, this alloted time will be too short to reliably connect to a server at all times, so you will need to implement a viable way to contact your servers reliably at all times.

It is important to remember that all background modes require App Review approval before your app can get to the App Store.

You can find more info through these links:

Core Bluetooth Background Processing for iOS Apps, for interacting with Bluetooth 4 devices: https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html#//apple_ref/doc/uid/TP40013257-CH7-SW1

Background execution - App Programming Guide, for enabling your app to perform actions in the background:

https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW1

Using NSURLSession, to give your app the ability to perform downloads while it is suspended:

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/UsingNSURLSession.html

Bluetooth whilst in background state
 
 
Q