2013-03-11 2 views
1

내 앱에서 Facebook SDK를 사용하여 Facebook에 연결하고 있습니다. 사용자는 친구에게 초대장을 보낼 수 있습니다. (FB SDK에서 제공하는 요청 대화 상자 사용).Facebook iOS App 친구 초대

https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/

그리고 나는 친구가 이미 초대하면 분명 친구 목록을 유지하기 위해 노력하고있어이 목록에서 친구를 숨기 (이제까지 친구가 허용되지 않았거나). 그러나 나는 이것을 할 길을 찾을 수 없습니다. 이것을 할 수있는 방법이 있습니까?

답변

0

요청을 보낸 친구를 제외 할 수는 없지만 친구에게 해당 친구를 추천하도록 제안 할 수는 있습니다. 아마도 당신이 이미 누구에게 당신이 요청을 보냈는지 알고 있다면 나머지 친구들과 함께 목록을 채울 수 있습니다.

1

페이스 북 문서는 끔찍하지만 난 그것을 다음과 같이 인증 된 친구를 제외 할 수 있습니다 발견 : "필터"@ "app_non_users"@

// See https://developers.facebook.com/docs/games/requests/v2.1 for explanation of the possible parameter keys 
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           // Optional parameter for sending request directly to user 
           // with UID. If not specified, the MFS will be invoked 
           // @"RECIPIENT_USER_ID", @"to", 
           // Give the action object request information 
           // @"send", @"action_type", 
           // @"YOUR_OBJECT_ID", @"object_id", 
            @"app_non_users", @"filters", 
           nil]; 

[FBWebDialogs 
presentRequestsDialogModallyWithSession:nil 
message:@"Join me!" 
title:@"Invite Friends" 
parameters:params 
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) { 
    if (error) { 
     // Case A: Error launching the dialog or sending request. 
     NSLog(@"Error sending request."); 
    } else { 
     if (result == FBWebDialogResultDialogNotCompleted) { 
      // Case B: User clicked the "x" icon 
      NSLog(@"User canceled request."); 
     } else { 
      NSLog(@"Request Sent."); 
     } 
    } 
}]; 

는, 중요한 부분입니다!