简体   繁体   中英

How to increase the number of check in places with Facebook API Graph on iOS

I'm looking to increase the number of check in places with Facebook API Graph on iOS.

I'm using the Hackbook sample and currently there are only 5 places to check in displayed in the UITableView.

the following method has a distance parameter, but I couldn't find a checkin number of places to return...

/*
 * Graph API: Search query to get nearby location.
 */
- (void)apiGraphSearchPlace:(CLLocation *)location {
    [self showActivityIndicator];
    currentAPICall = kAPIGraphSearchPlace;
    NSString *centerLocation = [[NSString alloc] initWithFormat:@"%f,%f",
                                location.coordinate.latitude,
                                location.coordinate.longitude];
    HackbookAppDelegate *delegate = (HackbookAppDelegate *)[[UIApplication sharedApplication] delegate];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @"place",  @"type",
                                   centerLocation, @"center",
                                   @"3000",  @"distance",
                                   nil];
    [centerLocation release];
    [[delegate facebook] requestWithGraphPath:@"search" andParams:params andDelegate:self];
}

If anyone knows how to do this please let me know.

thanks

Ok, I found it in the - (void)request:(FBRequest *)request didLoad:(id)result method:

case kAPIGraphSearchPlace:
        {
            NSMutableArray *places = [[NSMutableArray alloc] initWithCapacity:1];
            NSArray *resultData = [result objectForKey:@"data"];
            for (NSUInteger i=0; i<[resultData count] && i < 15; i++) {
                [places addObject:[resultData objectAtIndex:i]];
            }
            // Show the places nearby in a new view controller
            APIResultsViewController *controller = [[APIResultsViewController alloc]
                                                initWithTitle:@"Check In"
                                                data:places
                                                action:@"places"];
            [self.navigationController pushViewController:controller animated:YES];
            [controller release];
            [places release];
            break;
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM