Skip to content

Instantly share code, notes, and snippets.

View Kevinwlee's full-sized avatar

Kevin Lee Kevinwlee

View GitHub Profile
data = {
altitude = "18.16732978820801";
beacon = {
major = 32872;
minor = 7821;
proximity = "immediate_state";
rssi = "-40";
uuid = "E2C56DB5-DFFB-48D2-B060-8876223462A3";
};
course = "-1";
data = {
"current_activity" = {
activities = (
stationary
);
confidence = 2;
"start_date" = "2014-03-26 21:32:51 +0000";
};
"previous_activity" = {
activities = (
function (event, push, vault) {
// text box starts here!
}
{
"created_at": "2014-03-26T21:20:24+00:00",
"id": "ca911d07-55c2-4360-afb0-2f246917418a",
"name": "geofence_in",
"data": {
"altitude": "0",
"course": "-1",
"datetime": "2014-03-26 21:20:24 +0000",
"device_id": "BEE8D95B-01FF-4835-8A71-F1D89A39771C",
"fence": {
Hi
@Kevinwlee
Kevinwlee / create-beacon.mm
Last active August 29, 2015 14:03
How to create a beacon
[[CCHBeaconService sharedInstance] createBeaconWithProximityUUID:uuid major:major minor:minor name:@"Beacon" tags:@"demo" completionHandler:^(NSDictionary *beacon, NSError *error) {
// beacon dictionary has info about beacon created
}];
@Kevinwlee
Kevinwlee / get-beacon.mm
Last active August 29, 2015 14:03
Retrieving beacons
[[CCHBeaconService sharedInstance] getBeaconWithId:@"100" completionHandler:^(NSDictionary *beacon, NSError *error) {
// beacon dictionary has info about beacon retrieved
}];
@Kevinwlee
Kevinwlee / get-beacons.mm
Last active August 29, 2015 14:03
Get beacons by tags
[[CCHBeaconService sharedInstance] getBeaconsWithTags:@[@"demo"] completionHandler:(NSArray *beacon, NSError *error) {
// access first beacon like so: beacon[0]
}];
@Kevinwlee
Kevinwlee / update-beacon.mm
Last active August 29, 2015 14:03
Updating beacons
[[CCHBeaconService sharedService] updateBeacon:beacon completionHandler:(NSError *error) {}];
@Kevinwlee
Kevinwlee / delete-beacon.mm
Last active August 29, 2015 14:03
Deleting a beacon
[[CCHBeaconService sharedService] deleteBeacon:beacon completionHandler:(NSError *error) {}];