在Facebook api中如何设置Feeds的限制以获得下一个5个Feed?

时间:2013-05-06 06:08:43

标签: ios facebook

我使用以下代码获取Feed:

NSDictionary *dirTemp;

NSError *error;

NSStringEncoding encoding;

NSString *strUrl = [NSString stringWithFormat:@"https://graph.facebook.com/%@/posts?access_token=AppID|AppSecret&limit=5",strIdValue];
//NSLog(@"Your String URL is %@",strUrl);

NSURL *url = [NSURL URLWithString:[strUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

NSString *strResonse = [NSString stringWithContentsOfURL:url usedEncoding:&encoding error:&error];

dirTemp = [strResonse JSONValue];

1 个答案:

答案 0 :(得分:0)

NSDictionary *dirTemp;

NSStringEncoding encoding;

NSString *strUrl = [NSString stringWithFormat:@"graph.facebook.com/%@/…;

NSURL *url = [NSURL URLWithString:[strUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 

NSString *strResonse = [NSString stringWithContentsOfURL:url usedEncoding:&encoding error:&error];
dirTemp = [strResonse JSONValue];
NSDictionary *paginationDict=[dirTemp valueForKey:@"paging"];
NSString *pagelink=[[NSString alloc]initWithString:[paginationDict objectForKey:@"next"]];