이 링크를 참조하십시오. https://github.com/Constantine-Fry/Foursquare-API-v2/tree/master/Foursquare2-iOS. iPhone 용 Foursquare API를 쉽게 통합 할 수 있습니다.
안녕하세요 Marco, Foursquare2 폴더를 프로젝트에 추가하고보기 컨트롤러에서 인증을 확인하십시오. 다음 코드를 참조하십시오. 그것은 당신을 도울 것입니다.
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Foursquare";
//check the authentication
if ([Foursquare2 isNeedToAuthorize]) {
//If needed show the webview
webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
NSString *url = [NSString stringWithFormat:@"https://foursquare.com/oauth2/authenticate?display=touch&client_id=%@&response_type=code&redirect_uri=%@",OAUTH_KEY,REDIRECT_URL];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
[webView loadRequest:request];
[webView setDelegate:self];
[self.view addSubview:webView];
[webView release];
mTableView.hidden = YES;
}else{
//Show your view
mTableView.hidden = NO;
[Foursquare2 searchVenuesNearByLatitude:@"40.763" longitude:@"-73.990" accuracyLL:nil altitude:nil accuracyAlt:nil query:@"" limit:@"15" intent:@"" callback:^(BOOL success, id result){
if (success) {
tableData = [[FoursquareParser parseSearchVenuesResultsDictionary:(NSDictionary*)result] retain];
[mTableView reloadData];
}
}];
}
}
스토리 보드 (SDK 4.1)를 사용하려면이 API를 어떻게 통합해야합니까? – Marco