iPhone中的Foursquare集成

前端之家收集整理的这篇文章主要介绍了iPhone中的Foursquare集成前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正试图在iPhone中进行FourSquare集成.我无法通过Goggling找到任何好的指导方针….任何人都可以向我推荐iPhone中的FourSquare集成的良好指南或URL.

谢谢

解决方法

这是foursquare api link

Foursquare integration link的示例.

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

            }
        }];

    }
}

猜你在找的Xcode相关文章