Facebook请求永远不会得到执行 [英] Facebook Request Never Gets Executed
问题描述
获取其他朋友使用此功能的时间应用程序总是打印出来
但是打印结果和错误都不是
我用Facebook的Graph API资源管理器检查了图形路径,但是它的工作原理是不合适的。
- (void)getFriendsForUser:(NSNotification *)notification {
GGUser * theCurrentUser = [notification object];
NSLog(@Time to get other friends are use this app);
[FBRequestConnection startWithGraphPath:@me / friends?fields = id,name,installed,picture参数:nil HTTPMethod:@GETcompletionHandler:^(FBRequestConnection * connection,id result,NSError * error){
NSLog(@result%@,result);
NSLog(@error - %@,error);
}];
}
其他FBR请求,像@我的图形路径一样工作,只是不是这个。我究竟做错了什么?如何解决这个问题?
似乎你没有传递令牌,这就是为什么请求本身没有被执行: / p>
执行此操作:
FBRequest * facebookReq = [FBRequest requestForGraphPath:@ 我/朋友的字段= ID,名字,安装,图片?];
[facebookReq setSession:FBSession.activeSession];
[facebookReq startWithCompletionHandler:^(FBRequestConnection * connection,
id result,
NSError * error){
NSLog(@result%@,result);
NSLog(@error%@,error);
}];
让我知道如果不行。 :)
干杯
I am trying to get a user's Facebook Friends who also use the same app.
"Time to get other friends that use this app" always prints out
But neither the result, nor the error are printed
I checked the graph path with Facebook's Graph API explorer, and it worked, but it does not work with my app for some reason.
- (void)getFriendsForUser:(NSNotification *)notification {
GGUser *theCurrentUser = [notification object];
NSLog(@"Time to get other friends that use this app");
[FBRequestConnection startWithGraphPath:@"me/friends?fields=id,name,installed,picture" parameters:nil HTTPMethod:@"GET" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSLog(@"result %@",result);
NSLog(@"error - %@", error);
}];
}
Other FBRequests, like with a graph path of @"me", work, just not this one. What am I doing wrong? How do I fix this?
It seems you are not passing the token that's why the request itself is not getting executed:
Do this:
FBRequest *facebookReq = [FBRequest requestForGraphPath:@"me/friends?fields=id,name,installed,picture"];
[facebookReq setSession:FBSession.activeSession];
[facebookReq startWithCompletionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
NSLog(@"result %@",result);
NSLog(@"error %@",error);
}];
Let me know if it doesn't work. :)
Cheers
这篇关于Facebook请求永远不会得到执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!