0

我正在制作一个“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];
    }
}

谢谢

4

1 回答 1

1

打开会话:

 [FBSession.activeSession openWithCompletionHandler:^(FBSession * session, FBSessionState state, NSError * error){
        if (!error){

        }
    }];
于 2013-10-07T03:13:00.780 回答