Background mode in IOS

Ask, and ye shall receive.
arickatz
Posts: 22
Joined: 09:51, 11 Jan 2015

Background mode in IOS

Postby arickatz » 09:54, 11 Mar 2015

Hi again,
I am testing the evothings cordova plugin with an Iphone 5c IOS 8.2.
I see that the scan function is not working in the background. It works in the foreground perfectly
and on android also works in the background perfectly, but for some reason on IOS it cannot scan.
Should I use a different function (I need to scan for a specific UUID)?
Do I need to set anything on the phone or on xcode? I chekc in xcode the background modes for: location updates, use Bluetooth le accessories, background fetch
and remote notifications.

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: Background mode in IOS

Postby micke » 15:38, 15 Mar 2015

Hi,

Is it the cordova-ble plugin you are using?

You would need to add settings to Xcode to make background scanning work. This is currently not automatically added when you add the plugin, but should be added.

Here is some links to info about iOS background processing (mostly iBeacon related):

https://github.com/evothings/phonegap-e ... processing

Added an issue in the cordova-ble plugin repo for this:

https://github.com/evothings/cordova-ble/issues/57

Best regards, Mikael

arickatz
Posts: 22
Joined: 09:51, 11 Jan 2015

Re: Background mode in IOS

Postby arickatz » 16:37, 15 Mar 2015

Thanks for the reply,
Yes, I am using the cordova ble plugin
Could you please be more explicit about the added settings required in xcode?
I did add all the core Bluetooth and location properties to the background services from xcode ui and
added the relevant strings to the .plist file, any other things I need to add?
should the startScan and the connect functions both work in background mode?

arickatz
Posts: 22
Joined: 09:51, 11 Jan 2015

Re: Background mode in IOS

Postby arickatz » 19:24, 15 Mar 2015

I am continuing my test and it seems that I am getting the connect function to work.
I haven't tested the scan function, yet.

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: Background mode in IOS

Postby micke » 22:12, 18 Mar 2015

Hello, it should be sufficient to add the bluetooth-central background mode in the plist settings. Have not tested this yet however.
Best, Micke

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: Background mode in IOS

Postby micke » 15:42, 21 Mar 2016

Support for BLE background scanning on iOS available in this branch: https://github.com/mikaelkindborg/cordo ... background

Will be merged to master branch.


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 25 guests