IOS Corebluetooth advertising and scanning in the background

I am currently working on an iOS application that runs in the background, which requires me to advertise and scan the device using Bluetooth 4.0.

When I learned about Corebluetooth.framework, I found that iOS developers can install two kinds of advertising data on a peripheral device.

  • local device name.
  • service UUIDs.

I found out if the peripheral is running in the background, however the local name will not be advertised. In addition, service UUIDs will be configured for an overflow area that the central unit can only receive through active scanning. However, active scanning can only be performed in the foreground.

At this moment I have a question.

If both central and peripheral devices are running in the background, can the central device receive service UUIDs that are set in the overflow area of ​​the peripheral device? That is, when both iOS applications are running in the background, is it possible to develop an application that each application advertises and scans each other in the background?

+6
source share
1 answer

A background peripheral cannot be found using the background center for exactly the reasons you describe:

  • peripheral does not advertise services
  • the central part can only scan with service filtering (in the background)

This is a problem in iOS 6, and so far I have not seen anyone able to do this in iOS 7. (Further testing continues.)

+3
source

Source: https://habr.com/ru/post/955963/


All Articles