0
我正在使用此代碼,發送邀請朋友請求Facebook freinds,此代碼給出的消息是用戶取消的請求。發送Facebook朋友請求邀請返回消息:用戶取消請求
[FBRequestConnection startWithGraphPath:@"/me/friends"
parameters:nil
HTTPMethod:@"GET"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
) {
// NSLog(@"%@", result);
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat:@"%@", result], @"to", @"send", @"action_type", @"YOUR_OBJECT_ID", @"object_id", nil];
//for (NSDictionary *params in [result objectForKey:@"data"])
{
[FBWebDialogs
presentRequestsDialogModallyWithSession:nil
message:@"Learn how to make your iOS apps social."
title:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or sending request.
NSLog(@"Error sending request.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(@"User canceled request.");
} else {
// Handle the send request callback
NSDictionary *urlParams = [appDelegate parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"request"]) {
// User clicked the Cancel button
NSLog(@"User canceled request.");
} else {
// User clicked the Send button
NSString *requestID = [urlParams valueForKey:@"request"];
NSLog(@"Request ID: %@", requestID);
}
}
}
}];
}
}];
我想發送請求只有密友在facebook上.. – 2015-02-06 09:29:55