4

我正在尝试在 iPhone 中进行 FourSquare 集成..我无法通过 Goggling 找到任何好的指南.. 任何人都可以建议我在 iPhone 中进行 FourSquare 集成的良好指南或 URL..

谢谢

4

1 回答 1

1

这是foursquare api链接

Foursquare集成链接示例。

Foursquare 集成的更多代码

- (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];

            }
        }];

    }
}
于 2013-02-18T05:26:45.203 回答