开发者

How to get feed of a page and picture in high res with FQL

I'm trying to get all the feeds from a page like coca-cola and I want to get the related picture of this page in big resolution I only have small version. But I don't know how to get the big version from the feed directly.

I'm using ios-faceboo开发者_如何学Ck-sdk.

// Get Feed
[_facebook requestWithGraphPath:@"coca-cola/feed" andDelegate:self];

// Get Photo
NSString *req = @"SELECT pid,owner,src_big, object_id FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner = 40796308305 )";
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                req, @"query",
                                [_facebook accessToken], @"access_token",
                                nil];
[_facebook requestWithMethodName:@"fql.query"
                       andParams:params
                   andHttpMethod:@"POST"
                     andDelegate:self];


I found it if you pass by the albums you can retrieve photo in high res.

- (IBAction)getPageFeed:(id)sender {
    NSLog(@"[%d] %s", __LINE__, __FUNCTION__);
    // Get Feed
    [_facebook requestWithGraphPath:@"APIID/feed" andDelegate:self];
}

- (IBAction)getGetAlbums:(id)sender {
    NSLog(@"[%d] %s", __LINE__, __FUNCTION__);
    [_facebook requestWithGraphPath:@"APIID/albums" andDelegate:self];    
}

- (IBAction)getAllPhotos:(id)sender {
    NSLog(@"[%d] %s", __LINE__, __FUNCTION__);

    int index = 0;
    int iteration = 0;
    for (id i in [sender objectForKey:@"data"]) {
        if ([[i objectForKey:@"name"] isEqual:@"Wall Photos"]) {
            index = iteration;
        }
        iteration++;
    }
    [_facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/photos", [[[sender objectForKey:@"data"] objectAtIndex:index] objectForKey:@"id"]] andDelegate:self];    
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜