user3430865
user3430865

Reputation: 11

Ios Application connected in Background with device

i have an application that is connected with a chip by bluetooth. Device and phone are constantly connected to calculate the distance between them by bluetooth delay in reply. App is working fine in foreground. When i go background the app is still running, but cannot connect to the device.

I already tried to fix with this guide: Core Bluetooth Programming Guide but i didnt made it.

Some suggestion?

Upvotes: 0

Views: 56

Answers (1)

Lin Li
Lin Li

Reputation: 11

You need to introduce more detail. Your app will not run in background mode even bluetooth connection is on. But your app still have a chance to execute some code in a short time if some bluetooth event happen.

  • Connection lost.
  • Notification received.

If your application work like anti-loss bluetooth tag, you need

  1. Enable background in iOS app.
  2. Write your code in core bluetooth delegate.

And One reminder: Calculate distance based on bluetooth relay is not smart. Bluetooth communication is not designed to support this kind of feature.

It work on license free 2.4G band and human body has big impact on it.

Upvotes: 0

Related Questions