Facebook就像一个帖子

时间:2013-02-05 13:39:50

标签: ios objective-c facebook-graph-api facebook-like objective-c-blocks

我正在尝试在ios中添加我的应用程序中的按钮。当我在图形api资源管理器中点击url它工作正常,并给我回应真实。但是当我在我的代码中点击这个时没有发生任何事情

(void)likeFacebookPost:(NSString*)likeID
{

    NSString *theWholeUrl = [NSURL URLWithString:[NSString stringWithFormat:
                                                  @"%@/%@/likes&access_token=%@",
                                                  GRAPH_API_BASEURL,likeID,
                                                  [_facebookToken stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];



    NSURL *facebookUrl = [NSURL URLWithString:theWholeUrl];

    NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:facebookUrl];
    [req setHTTPMethod:@"POST"];

    NSURLResponse *response;
    NSError *err;
    NSData *responseData = [NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&err];
    NSString *content = [NSString stringWithUTF8String:[responseData bytes]];

    NSLog(@"responseData: %@", content);

}

0 个答案:

没有答案