1
所以,這裏是我的FQL查詢檢索地點爲用戶事件:FQL查詢iOS中的事件不工作
NSString* fql1 = [NSString stringWithFormat:
@"SELECT venue from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me())"];
NSString* fql2 = [NSString stringWithFormat:
@"SELECT name FROM page WHERE page_id IN (SELECT venue.id FROM #event_info)"];
NSString* fqlStr = [NSString stringWithFormat:
@"{\"event_info\":\"%@\",\"event_venue\":\"%@\"}",fql1,fql2];
NSDictionary* params = [NSDictionary dictionaryWithObject:fqlStr forKey:@"queries"];
FBRequest *fql = [FBRequest requestWithGraphPath:@"fql.query" parameters:params HTTPMethod:@"POST"];
[fql startWithCompletionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (result) {
NSLog(@"result:%@", result);
}
if (error) {
NSLog(@"error:%@", error);
}
}];
查詢本身是好的,我試圖在圖形API瀏覽器。但我得到這個錯誤:
error:Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1f01da20 {com.facebook.sdk:HTTPStatusCode=403, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 240;
message = "(#240) Requires a valid user to be specified (either via the session or via the API parameter for specifying the user.";
type = OAuthException;
};
};
code = 403;
}, com.facebook.sdk:ErrorSessionKey=<PFReceptionist: 0xb2426b0>}
我做錯了什麼?這不是我對會話的第一個查詢,我要求提供user_events權限和事件工作正常的簡單非FQL查詢。