Skip to content

Instantly share code, notes, and snippets.

@birarda
Created October 27, 2012 18:29
Show Gist options
  • Save birarda/3965598 to your computer and use it in GitHub Desktop.
Save birarda/3965598 to your computer and use it in GitHub Desktop.
CPapi example
+ (void)getNearestVenuesWithCheckinsToCoordinate:(CLLocationCoordinate2D)coordinate
mapQueue:(NSOperationQueue *)mapQueue
completion:(void (^)(NSDictionary *, NSError *))completion
{
// parameters for API call
// you could also send checked_in_since (timestamp) and limit (integer) to this call
// those default to 1 week ago and 25
NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setValue:[NSString stringWithFormat:@"%f", coordinate.latitude] forKey:@"lat"];
[params setValue:[NSString stringWithFormat:@"%f", coordinate.longitude] forKey:@"lng"];
[self makeHTTPRequestWithAction:@"getNearestVenuesAndUsersWithCheckinsDuringInterval" withParameters:params queue:mapQueue timeout:9 completion:completion];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment