0
我正在做一個「FBRequestConnection」讓所有玩遊戲的朋友...FBRequestConnection沒有迴應
當我更新的Facebook的最後一個SDK,這個停止工作。因爲它以前工作。
我沒有迴應,沒有成功,沒有錯誤。有任何想法嗎?
NSString *query = @"SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1";
// Set up the query parameter
NSDictionary *queryParam = [NSDictionary dictionaryWithObjectsAndKeys:query, @"q", nil];
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:queryParam
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
[self debug:[NSString stringWithFormat:@"Error: %@", [error localizedDescription]]];
} else {
[self debug:[NSString stringWithFormat:@"Result: %@", [result objectForKey:@"data"]]];
}
}];
-(void)fbLogin {
if (!_session.isOpen) {
// create a fresh session object
_session = [[FBSession alloc] init];
// if we don't have a cached token, a call to open here would cause UX for login to
// occur; we don't want that to happen unless the user clicks the login button, and so
// we check here to make sure we have a token before calling open
if (_session.state == FBSessionStateCreatedTokenLoaded) {
// even though we had a cached token, we need to login to make the session usable
[_session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// we recurse here, in order to update buttons and labels
[[NSNotificationCenter defaultCenter] postNotificationName:@"fbConnected" object:nil];
}];
}
[self populateUserDetails];
}
}
感謝
你在API Explorer來測試這使你的FQL查詢確認的東西還沒有被棄用? – AdamG
@AdamG是的,我剛剛做到了,它會返回所有uid,就像我期望的一樣。 – Edig
你的會話狀態是否打開? – AdamG