2013-03-11 153 views
1

我正在使用Facebook SDK在我的應用程序中連接Facebook。用戶可以發送邀請給他們的朋友。 (使用FB SDK提供的請求對話框)。Facebook iOS應用程序邀請好友

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

而且我試圖保持好友列表清楚,如果朋友是否已經收到邀請(曾經的朋友被接受與否),從列表中隱藏的朋友。但我找不到這樣做的方式。有沒有辦法做到這一點?

回答

0

我不認爲你可以排除有請求發送給他們的朋友,但你可以建議朋友填寫該列表。也許如果您已經知道您向誰發送了請求,您可以將其與其他朋友一起填充到列表中。

1

Facebook的文檔是可怕的,但我發現它是可以排除認證朋友如下:

// 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."); 
     } 
    } 
}]; 

@「app_non_users」,@「過濾器」,是最重要的部分!

相關問題