iphone中的Foursquare集成的实现

原问题来自于CSDN问答频道,更多解决方案见:http://ask.csdn.net/questions/1404

原问题描述:

需要实现iphone中关于Foursquare集成,但是不知道从何入手,请帮忙给一些建议和指点。谢谢

解决方案:

这里是foursquare api 链接

Foursquare integration 示例链接

更多代码:Foursquare integration

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

            }
        }];

    }
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值