This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLLLocationDegrees lat = -29.7635349f; | |
CLLLocationDegrees lng = -95.4619215f; | |
CCLLocationCoordinate2D center = CLLLocationCoordinate2DMake(lat, lng); | |
CLLLocationDistance radius = 20.0f; // in meters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHGeofenceService sharedInstance] createGeofenceWithCenter:center radius:radius name:@"Geofence" tags:@"demo" completionHandler:^(NSDictionary *geofence, NSError *error) { | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHGeofenceService sharedInstance] getGeofenceWithId:@"100" completionHandler:^(NSDictionary *geofence, NSError *error) { | |
// geofence dictionary has info about geofence created | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHGeofenceService sharedInstance] getGeofencesWithTag:@"demo" location:location radius:radius completionHandler:(NSArray *geofences, NSError *error) { | |
// access first geofence like so: geofences[0] | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHGeofenceService sharedService] updateGeofence:geofence completionHandler:(NSError *error) {}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHGeofenceService sharedService] deleteGeofence:geofence completionHandler:(NSError *error) {}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHSensorPipeline sharedInstance] addSubscriptionForTags:@[@"demo"]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[NSNotificationCenter defaultCenter] addObserver: self selector:@selector("your-method-here") name: CCHSensorPipelineDidPostEvent object:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)handleNotification:(NSNotification *)notification { | |
NSDictionary *event = notification.object; | |
// handle event notification here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[CCHSubscriptionService sharedInstance] addGeofenceSubscriptionForTags:@[@"demo"] completionHandler:^(NSError *error){}]; |