Skip to content

Instantly share code, notes, and snippets.

View Kevinwlee's full-sized avatar

Kevin Lee Kevinwlee

View GitHub Profile
@Kevinwlee
Kevinwlee / location-changed.mm
Last active August 29, 2015 14:03
Sample location changed event
data = {
altitude = 0;
course = 0;
datetime = "2014-03-26 20:07:41 +0000";
"device_id" = "BEE8D95B-01FF-4835-8A71-F1D89A39771C";
latitude = 0;
longitude = 0;
speed = 0;
};
@Kevinwlee
Kevinwlee / geofence-in.mm
Last active August 29, 2015 14:03
Sample geofence in event
data = {
altitude = 0;
course = "-1";
datetime = "2014-03-26 21:20:24 +0000";
"device_id" = "BEE8D95B-01FF-4835-8A71-F1D89A39771C";
fence = {
id = sandcreek;
latitude = "30.054381";
longitude = "-95.17071199999999";
radius = 100;
@Kevinwlee
Kevinwlee / beacon-changed.mm
Last active August 29, 2015 14:03
Sample beacon changed event
data = {
altitude = "18.16732978820801";
beacon = {
major = 32872;
minor = 7821;
proximity = "immediate_state";
rssi = "-40";
uuid = "E2C56DB5-DFFB-48D2-B060-8876223462A3";
};
course = "-1";
@Kevinwlee
Kevinwlee / beacon-in-event.mm
Last active August 29, 2015 14:03
Sample beacon in event
data = {
altitude = "21.54464340209961";
beacon = {
major = "";
minor = "";
name = JP;
uuid = "E2C56DB5-DFFB-48D2-B060-8876223462A3";
};
course = "-1";
datetime = "2014-03-26 20:38:20 +0000";
@Kevinwlee
Kevinwlee / sample-event.mm
Last active August 29, 2015 14:03
Sample event
{
event = {
context = (
{
"location_context" = {
"location_context" = {
altitude = 0;
course = 0;
datetime = "2014-03-26 20:07:41 +0000";
"device_id" = "BEE8D95B-01FF-4835-8A71-F1D89A39771C";
@Kevinwlee
Kevinwlee / did-receive.mm
Last active August 29, 2015 14:03
Tell contextHub when a push is received
[[CCHPush sharedInstance] application:application didReceiveRemoteNotification:userInfo completionHandler:completionHandler];
@Kevinwlee
Kevinwlee / add-geofence-subscription.mm
Last active August 29, 2015 14:03
Adding a geofence subscription
[[CCHSubscriptionService sharedInstance] addGeofenceSubscriptionForTags:@[@"demo"] completionHandler:^(NSError *error){}];
@Kevinwlee
Kevinwlee / notification-object.mm
Last active August 29, 2015 14:03
Sample handler
- (void)handleNotification:(NSNotification *)notification {
NSDictionary *event = notification.object;
// handle event notification here
}
@Kevinwlee
Kevinwlee / add-observer.mm
Last active August 29, 2015 14:03
Observing sensor pipeline events
[[NSNotificationCenter defaultCenter] addObserver: self selector:@selector("your-method-here") name: CCHSensorPipelineDidPostEvent object:nil];
@Kevinwlee
Kevinwlee / add-subscription.mm
Last active August 29, 2015 14:03
Add a subscription
[[CCHSensorPipeline sharedInstance] addSubscriptionForTags:@[@"demo"]];