Skip to content

Instantly share code, notes, and snippets.

View Kevinwlee's full-sized avatar

Kevin Lee Kevinwlee

View GitHub Profile
@Kevinwlee
Kevinwlee / delete-geofence.mm
Last active August 29, 2015 14:03
Deleting a geofence
[[CCHGeofenceService sharedService] deleteGeofence:geofence completionHandler:(NSError *error) {}];
@Kevinwlee
Kevinwlee / update-geofence.mm
Last active August 29, 2015 14:03
Update geofence
[[CCHGeofenceService sharedService] updateGeofence:geofence completionHandler:(NSError *error) {}];
@Kevinwlee
Kevinwlee / get-geofences.mm
Last active August 29, 2015 14:03
Get geofences with tags
[[CCHGeofenceService sharedInstance] getGeofencesWithTag:@"demo" location:location radius:radius completionHandler:(NSArray *geofences, NSError *error) {
// access first geofence like so: geofences[0]
}];
@Kevinwlee
Kevinwlee / get-geofence.mm
Last active August 29, 2015 14:03
Get a geofence
[[CCHGeofenceService sharedInstance] getGeofenceWithId:@"100" completionHandler:^(NSDictionary *geofence, NSError *error) {
// geofence dictionary has info about geofence created
}];
@Kevinwlee
Kevinwlee / create-geofence.mm
Last active August 29, 2015 14:03
Create geofence
[[CCHGeofenceService sharedInstance] createGeofenceWithCenter:center radius:radius name:@"Geofence" tags:@"demo" completionHandler:^(NSDictionary *geofence, NSError *error) {
}];
@Kevinwlee
Kevinwlee / geofence-params.mm
Last active August 29, 2015 14:03
Geofence parameters
CLLLocationDegrees lat = -29.7635349f;
CLLLocationDegrees lng = -95.4619215f;
CCLLocationCoordinate2D center = CLLLocationCoordinate2DMake(lat, lng);
CLLLocationDistance radius = 20.0f; // in meters
@Kevinwlee
Kevinwlee / delete-beacon.mm
Last active August 29, 2015 14:03
Deleting a beacon
[[CCHBeaconService sharedService] deleteBeacon:beacon completionHandler:(NSError *error) {}];
@Kevinwlee
Kevinwlee / update-beacon.mm
Last active August 29, 2015 14:03
Updating beacons
[[CCHBeaconService sharedService] updateBeacon:beacon completionHandler:(NSError *error) {}];
@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 / 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
}];