Replicates detecting and broadcasting iBeacons in the background

Related tags

iBeacon Vicinity
Overview

Vicinity

Vicinity replicates iBeacons and supports broadcasting and detecting low-energy bluetooth devices in the background.

It is built with CoreBluetooth framework and doesn't use CoreLocation to implement iBeacons. CoreLocation itself limits how it can be used when apps are in the background, whereas CoreBluetooth fully supports background operations.

What is iBeacon

The term iBeacon describes the ability of low-engergy bluetooth devices to broadcast and detect proximity of devices by analyzing the received signal strength of the wireless bluetooth signal.

In the iOS SDK iBeacons are implemented in the CoreLocation framework—which places many limits on how it can be used in the background.

The CoreBluetooth framework itself supports RSSI (received signal strength indication), which is all that it is needed to replicate the iBeacon sections of CoreLocation.

The problem with using CoreLocation to detect iBeacons is this functionality is very limited once an app is in the background. CoreBluetooth has much greater background support of iOS apps. With CoreBluetooth, you can broadcast as a peripheral and detect as a central while in the background. The framework will even allow limited actions within your app code while these services are running.

INBeaconService

The heart of this is INBeaconService. This replicates how iBeacons work by analyzing RSSI of low-energy bluetooth broadcasts. Most of the work is done using CBPeripheralManager and CBCentralManager, which are classes in the CoreBluetooth framework.

Getting this to work effectively required a two things:

  1. interpreting the RSSI values reliably, taking into account sensor noise and signal spikes
  2. converting the RSSI values to distances

Signal Noise

When Reading data from sensors on iOS, be that accelerometer or RSSI, the values can contain a lot of noise and spikes. I initially tried to use a weighted average which didn't work that well. Applying an "easing function" to smooth out the incoming signal values worked much better.

RSSI to Distance

Converting the RSSI values to distances was a matter of trial and error. I also cheated by realizing that iBeacons uses fuzzy distance terms like "Far", "Near", and "Immediate". The reason for these values became obvious once we analyzed the actual data. Bluetooth RSSI flucuates wildly at ranges beyond five feet and becomes more accurate at values less than 1 foot.

Supposedly, different bluetooth devices are going to have varying signal strengths, but the smattering of iOS devices we measured reported the same values.

Conclusion

We hope this simple app will come in useful.

Contact us with questions!

Comments
  • Broadcasting in background does not work (iOS 7.1)

    Broadcasting in background does not work (iOS 7.1)

    I am not able to broadcast in the background using this project. Once I minimize the App, the broadcast stops. Has anyone else had the background broadcast work?

    opened by objectiveSee 4
  • Problem ranging real iBeacons

    Problem ranging real iBeacons

    Hi, It looks like there is a problem when detecting the real iBeacon signals. When two instances of Vicinity is running on different devices (one for advertising and one for detecting) they see each other. However, when I use a real iBeacon, Vicinity can not detect the signals. It is always out of range. I did not forget to provide the correct "SINGLETON_IDENTIFIER" value for estimate beacons. This is also true for advertising. Vicinity signals can not be detected as iBeacon signals (as an example, can'be detected by Estimote app). So is this example only meant to work with "Vicinity way" of beacons or am I missing out something?

    opened by omergul 3
  • Support for iOS Simulator

    Support for iOS Simulator

    I am unable to toggle into broadcast mode in the iOS Simulator. Looking at the code, it seems that since both isDetecting and isBroadcasting are false, nothing happens when you tap the toggle button.

    see - (void)didToggleMode:(UIButton *)button

    opened by objectiveSee 2
  • Detecting background broadcast while in the background

    Detecting background broadcast while in the background

    I'm having an issue detecting another device while both devices are in the background.

    I start one device and lock it, having it detect in the background. I start the app on the other device, having it broadcast in the foreground. Detecting device finds the broadcast, great.

    Then comes my problem:

    I restart the device in the background. This time I have the second device broadcast while in the background. The detecting device is not able to find it.

    Have you encountered this problem? Any ideas?

    Thanks

    opened by kennypolk 2
  • Beacon Advertising

    Beacon Advertising

    I am attempting to transmit beacons in the background on iOS devices while in Advertisement mode and not Connected Mode. I have a scanner that is able to pick up on various formatted beacons while they are within range. I am able to transmit and receive ibeacons when utilizing the coreloction framework, but I am not able to detect any beacons when utilizing this project. I do not want to establish any connections. I strictly want to transmit ble advertisements over the three established BLE advertising channels. Does this project allow for BLE advertising of UUID beacons while in "Advertisement Mode" and also in the background? Does another iOS device have to be specifically looking for this beacon? If that is the case, is there a way around that so a linux machine scanning the three advertising channels would be able to detect the UUID beacon?

    opened by JeffreyKidwell 2
  • Android version

    Android version

    I want to create a Vicinity android version. The app I am developing is cross platform. How should I approach this problem? How can I be able to scan and broadcast Vicinity signals on android? Thank you very much in advance!

    opened by mishig25 0
  • EasyLayout.h

    EasyLayout.h

    Hey all,

    I am trying out this project. However, I got ConsoleView.m complaining EasyLayout.h file not found.

    I am using latest Xcode and checked out the latest version of this project.

    Thanks, Frank

    opened by ghost 2
  • Update README.md

    Update README.md

    Included steps to build and run the project. There might be some frictions for those that don't know the project also utilizes EasyLayout as a submodule, and also it needs to open as workspace project via Xcode too.

    opened by haxpor 0
  • Device Reboot

    Device Reboot

    Hello,

    Have you been able to make this work after a device reboot? It seems that broadcasting and scanning both work in the background, but not after the device is restarted.

    Thanks,

    -Dave

    opened by djr 0
Owner
Instrument
Instrument
An iBeacon Manager library was created to simplify your interactions with iBeacons.

JMCiBeaconManager iBeacon is a name of technology that is enabling new location awareness possibilities for apps. "Leveraging Bluetooth Low Energy (BL

Izotx 146 Dec 17, 2022
Proxitee iOS SDK to enable iOS apps to use the Proxitee platform with iBeacon and GeoFencing

Proxitee iOS SDK Introduction The Proxitee iOS SDK allows you to enable your iOS devices to use the Proxitee platform with iBeacons and GeoFences, for

Proxitee 16 Jun 4, 2022
iBeacons + CoreBluetooth

OWUProximityManager Detect and connect to nearby devices with iBeacons and CoreBluetooth. Sample Project To simulate functionality, select Client on o

David Ohayon 363 Dec 24, 2022
An iBeacon Manager library was created to simplify your interactions with iBeacons.

JMCiBeaconManager iBeacon is a name of technology that is enabling new location awareness possibilities for apps. "Leveraging Bluetooth Low Energy (BL

Izotx 146 Dec 17, 2022
ImagePickerSheetController replicates the custom photo action sheet in iMessage.

ImagePickerSheetController About ImagePickerSheetController is a component that replicates the custom photo action sheet in iMessage. It's very simila

Laurin Brandner 1.5k Jan 3, 2023
CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.

CreditCardForm CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card. Fixed typo use CreditCa

Orazz 1.4k Dec 15, 2022
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

Lucas Ortis 1.5k Dec 28, 2022
Flutter package for detecting NSFW images and videos using native implementation

Flutter NSFW 1- Download, tflite modle and put it in assets folder 2 - Add the path of the tfliet to pubspec.yaml 3 - Read the file using path_provide

Syed Ahsan Ali 8 Oct 16, 2022
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

Lucas Ortis 1.5k Dec 28, 2022
Lightweight Cocoa library for detecting the running device's model and screen size.

Lightweight Cocoa library for detecting the running device's model and screen size. With the newer  devices, developers have more work to do. This li

Sebastian Dobrincu 1.3k Nov 24, 2022
Detecting Texts and Persons from Images

Detections Detecting Texts and Persons from Images Detections package will help you to get the texts from image and also recognize a person Image whih

Saeed Rahmatolahi 1 Nov 21, 2021
iOS framework that enables detecting and handling voice commands using microphone.

iOS framework that enables detecting and handling voice commands using microphone. Built using Swift with minumum target iOS 14.3.

Ahmed Abdelkarim 20 Aug 4, 2022
A computer-vision-driven app for detecting and mapping smog in public roads. Crowdsourcing is rewarded with NFTs. Uber Global Hackathon.

Smogify Detecting smog using ML and rewarding users with NFTs About The Project app in action: https://youtu.be/awJrP-sHb_I Under the growing uncertai

ASOFI 3 Aug 18, 2022
🌐 Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access.

Connectivity is a wrapper for Apple's Reachability providing a reliable measure of whether Internet connectivity is available where Reachability alone

Ross Butler 1.6k Dec 30, 2022
iOS library to help detecting retain cycles in runtime.

FBRetainCycleDetector An iOS library that finds retain cycles using runtime analysis. About Retain cycles are one of the most common ways of creating

Facebook 4.1k Dec 26, 2022
A tiny menu bar app detecting the chords of the songs you are listening on iTunes or Spotify.

ChordDetector A tiny menu bar app that listens iTunes and Spotify to detect chords of songs! Demo Features iTunes and Spotify support. Saves up to 20

Cem Olcay 72 Dec 26, 2022
Detecting Objects in Still Images

Detecting Objects in Still Images Locate and demarcate rectangles, faces, barcodes, and text in images using the Vision framework. Overview The Vision

우형준 1 Dec 9, 2021
Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)

Detecting Text in Natural Image with Connectionist Text Proposal Network The codes are used for implementing CTPN for scene text detection, described

Tian Zhi 1.3k Dec 22, 2022
Gyros-identifier - An iOS app capable of detecting whether a photo contains a gyros or not

gyros-identifier ??️ In case you enter a shady restaurant, with suspicious price

Alexandros Tzimas 3 Feb 25, 2022
UIWindow subclass to enable behavior like adaptive round-corners & detecting when Control Center is opened.

UIWindow subclass to enable behavior like adaptive round-corners & detecting when Control Center is opened.

Aaron Abentheuer 481 Jul 28, 2022