Giter Club home page Giter Club logo

hibeacons's Introduction

HiBeacons

A Swift 3 demo app for the iBeacons API in iOS 10, with Apple Watch support (watchOS 3.0)

HiBeacons is a fully functional demo app for the iBeacons API in iOS 10, updated for Swift 3. The app can be used to demonstrate beacon region monitoring, advertising and ranging, simply by toggling on/off three switches in the UI, or the accompanying Apple Watch app.

The apps implement a basic interface for starting all the operations from the iPhone and the Apple Watch, but the state of the various beacon operation can only be seen in the phone. (The watch app acts as a simple* remote).

The source is easy to understand and modify. The structure of the app is based on a simple hierarchy of operation classes. There are three NATOperation subclasses, each responsible of a specific operation: NATMonitoringOperation, NATAdvertisingOperation, and NATRangingOperation. The app is easy to use with any given proximity UUID and identifier, which can be changed in NATOperation.

The app is fully documented, using the reStructuredText standard, which SourceKit can parse.

The main branch of the project is the swift branch, but you can still find the old Objective-C code at the obj-c branch. Note that the old branch has some bugs, that I have fixed in the new one.

The app is fully documented, and should work well with Xcode 8, iOS 10, and watchOS 3.

Screenshots

Phone-Screenshot

Watch-Screenshot

Notes

  • The UI shows only a small number of alerts, when major issues occur. To understand the process better, you can easily follow the Console logs.
  • Monitoring works also when the app is in the background. You will get a local notification when entering the specified beacon region.
  • The app can only monitor and range a single beacon region. (It can easily be extended for multiple, but not for any beacon region. Apple only allows for specific UUIDs to be monitored or ranged.)
  • With advertising turned on, the app will show itself as a beacon on other instances of the app, or other beacon apps, running on other devices. It cannot range or monitor itself. (It's how the iBeacon API works.)
  • Major and minor integers are generated randomly every time a new advertising session starts.
  • You can find and set the UUID and identifier for the region in NATOperation.swift.

* The Watch app can trigger actions on and can reflect the state of the app on the phone, but will not accept state change in the background. The same applies vice-versa, i.e. the Watch app will be unable to operate on the app when it's backgrounded.

Contact

Nick Toumpelis (@nicktoumpelis)

Licence

HiBeacons is available under the MIT licence. See the LICENCE file for more info.

hibeacons's People

Contributors

falkorichter avatar hallski avatar jzau avatar nicktoumpelis avatar vivekjain10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hibeacons's Issues

UUID

I am not getting UUID. How to get UUID ?

let region = CLBeaconRegion(proximityUUID: NSUUID(UUIDString: "?")!, identifier: "Identifier")

First time crashes but never later

I turned on Ranging on iPod, and then turned Advertising on iPad.. . caused a crash on iPod (Ranging). This happened only on very first time, but never again.

Beacons don't show up

Setup

I want to build an audio guide application on iOS for an exhibition using iBeacons.

I am using the HiBeacons App from Github to test my iBeacons:

app

This works well and I can configure my iPad to show up as an iBeacon. So I can already start developing using my iPad as a dummy beacon.

The iBeacons

beacons

I did order a few iBeacons from Aliexpress.

I was expecting that the beacons show up in HiBeacons as soon as I turn them on. And when I press the button for some seconds the LED lights up either once or three times, but in both states the HiBeacons app does not show a new nearby device.

The Beacons all come with a label that shows the following information:

major: 10011
minor: 10011
wxid: 2976871
password: XXXXXXXX
ID: YYYYYYYYYYYYY

There is also a QR Code that contains the ID of the beacon.

Now I am left with these questions:

  1. What do I need to do so that the beacons show up in HiBeacon
  2. Are the wxid / password proprietary values or is this part of BLE spec

TI sensor Tag

Hi,
I cannot detect TI sensor tags (either cc2541 or cc2650) with your app. I was wondering what could be the reason? Thank you

Farshad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.