Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wake up iOS app with bluetooth signal (BLE)

When using the BLE with CoreBluetooth (no iBeacon), is there a way to wake an app that is not running when the device receives a Bluetooth signal?

I'm simulating a beacon with the RedBearlab's BLE Shield (http://redbearlab.com/bleshield/).

Thanks, DAN

* UPDATE 03/05/14 *

It looks like Apple has introduced a major update with iOS 7.1: now iOS will open your app for you if it detects a UUID that matches your app. The app only needs to be installed, it doesn't have to be running (logic in AppDelegate needed to answer the wake-up call).

like image 470
DAN Avatar asked Nov 12 '13 14:11

DAN


People also ask

Can Iphone connect to Ble?

Pairing Your Device On your iOS device go into "Settings-> Bluetooth" and turn on your BLE device. You should see the device listed in your available devices.

What is Bluetooth low energy in iOS?

It is a Bluetooth standard that allows to communicate with reduced energy and without the need to pair in the system settings. We illustrated a Bluetooth central implementation on iOS that connects on a peripheral simulated on a Mac.

What is ble app?

Android provides built-in platform support for Bluetooth Low Energy (BLE) in the central role and provides APIs that apps can use to discover devices, query for services, and transmit information. Common use cases include the following: Transferring small amounts of data between nearby devices.


1 Answers

If the app was running in the background and then closed (I mean here terminated - and you do not see it anymore in the list of background apps when you double click the home button) due to memory pressure from other apps, then the iOS will take care of waking it up again when a delegate is called (assuming you have background modes listed in .plist).

If the app was running in the background and then closed by the user (again I mean here terminated. So the user double clicked to get the list of apps running in the background and then clicked on your app in the background list until it wiggled and then pressed the 'x' next to the app to kill it) then this is a clear indication that the user does not want the app running in the background and the app will not be re-launched. The user has to relaunch the app for its delegates to start functioning again in the background (new in iOS7).

Update: I am not sure if this is in the documentation but it is in CoreBluetooth WWDC 2013 Video. I recommend you watch it. They spent a good portion of the video on how CoreBluetooth behaves in the background.

like image 65
Khaled Barazi Avatar answered Sep 27 '22 21:09

Khaled Barazi