Core Bluetooth Advertising in Background

Hello guys,

I have been trying to advertise in the background but I can’t seem to make it work.

In my case, I want if a device is acting as a peripheral and the app goes to the background it still can be discoverable and be able to write/read to/from it by the central.

I have added the background mode “Acts as a Bluetooth accessory”.

  1. When will willRestoreState be called?
  2. What should I do in willRestoreState?
  3. Will it always be discoverable or have some limitations?
  4. Should I stop advertising at any point?
  5. How should I clean up after the view is dismissed?
  6. Must the peripheral manager be initialized in the AppDelegate? and if so, will it always be advertising even if I don't want it to?
  7. What are the battery concerns?

Also, I have encountered an issue that my iPhone device can discover an Android device but not the opposite. What could be the problem of this?

Thank you.

Best regards

Core Bluetooth Advertising in Background
 
 
Q