2012-01-18 7 views
1

iPhoneでアプリを開発しています。グラフAPIを使用してFBにメッセージを送信して友達に招待する必要があります。実際に彼のすべての友人が表示され、ユーザーがメッセージを送信する彼の希望で友人を選択することができます実際にFBダイアログボックスである私のアプリの表示ダイアログボックス。おかげFBで友だちを招待してください。

答えて

-1

使用@ "facebook.events.invite" の方法は、iPhoneからあなたの友人を招待する

例えば

 params = [NSDictionary dictionaryWithObjectsAndKeys:facebookEventString,@"eid",udidsString,@"uids",nil]; 
     [[FBRequest requestWithDelegate:self] call:@"facebook.events.invite" params:params]; 
+0

を見つけることができます

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:nil]; [FBWebDialogs presentRequestsDialogModallyWithSession:nil message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", nScore] title:nil 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."); } }}]; 

私はすでにこの考えを知っていたが、私は彼の友人の特定を選択したユーザーにFB]ダイアログボックスが必要だってこれは、私が先ではありません。 – Aleem

4

あなたは以下のように摩擦の要求を使用してこれを行うことができます

NSString *to =[NSString stringWithFormat:@"%d",[[[FriendUIDArray 
objectAtIndex:index] 
                objectForKey:@"uid"] intValue]]; 

FBFrictionlessRecipientCache *friendCache = 
[[FBFrictionlessRecipientCache alloc] init]; [friendCache 
prefetchAndCacheForSession:nil]; 


NSMutableDictionary* params = [NSMutableDictionary 
dictionaryWithObjectsAndKeys: 
            to, @"to", 
            nil]; 

[FBWebDialogs presentRequestsDialogModallyWithSession:nil 
     message:[NSString stringWithFormat:@"I’m using Nightup to find great party's 
     around me."] title:nil 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."); 
                 } 
     }} 

     friendCache:friendCache]; 

あなたが招待したい特定の友人のUidを持っていない場合は、ダイアログで友人を選択できるこの方法に従います。あなたはより詳細にhere

関連する問題