https://github.com/kosso/tibeacon
A quick and dirty Titanium iOS module to for creating an iBeacon in your app.
https://github.com/kosso/tibeacon
bluetooth bluetooth-le ibeacon ios module titanium
Last synced: 6 months ago
JSON representation
A quick and dirty Titanium iOS module to for creating an iBeacon in your app.
- Host: GitHub
- URL: https://github.com/kosso/tibeacon
- Owner: kosso
- License: other
- Created: 2017-03-28T22:40:33.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-17T11:57:49.000Z (about 7 years ago)
- Last Synced: 2025-04-03T02:11:25.288Z (9 months ago)
- Topics: bluetooth, bluetooth-le, ibeacon, ios, module, titanium
- Language: Python
- Homepage:
- Size: 380 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE
Awesome Lists containing this project
README
tibeacon
===========================================
A *very* quick and dirty iOS Titanium module to make your app advertise an iBeacon.
See /example/app.js for a full test app with adjustable major/minor values.
REGISTER THE MODULE
--------------------
Register the module with your application by editing `tiapp.xml` and adding:
com.kosso.tibeacon
### IMPORTANT
##### DONT FORGET: Add the Bluetooth usage description to tiapp.xml in the section!!
**Or you will crash. Hard.**
```
NSBluetoothPeripheralUsageDescription
To be a beacon!
```
**************************************************************
USING THE MODULE
-------------------------
var tibeacon = require('com.kosso.tibeacon');
// Methods
tibeacon.isAdvertising(); // boolean
tibeacon.startAdvertising(); // defaults: major:0, minor:0, uuid:moduleGUID, identifier:moduleID
// major.minor range is 0 - 65535
// Will not set until next started if already advertising
tibeacon.minor = 4;
tibeacon.major = 10;
tibeacon.setMajor(1);
tibeacon.setMinor(10);
tibeacon.setUuid('12345678-abcd-88cc-1111aaaa2222');
tibeacon.startAdvertising({
identifier:'TestBeacon',
uuid:'ffffffff-ffff-ffff-ffff-ffffffffffff',
major:1,
minor:60
});
tibeacon.stopAdvertising();
// While the beacon is advertising, you can update the major/minor values using:
tibeacon.updateMajorMinor({
major:10,
minor:3042
});
## TO DO
- Set custom GUID. (Currently uses the module's one).
- Set power.
- .. get this added to other modules that don't support advertising ;)
-------
@kosso : March 2017