我正在从我的应用程序向fb朋友发送请求,但我没有在fb用户的墙上收到任何通知,我发送了请求?
我正在使用FB SDK 3.2(我希望它是最新的)
以下是我用来发送请求的代码NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
friendList, @"to",
nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", 15]
title:@"Total Smashed Score"
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.");
}
}
}
];
请求对话框正确显示,当我点击发送按钮邀请被发送,但不显示在用户墙上。任何形式的帮助都将是感激的。
问候。
邀请永远不会显示在用户的墙/时间轴上。只有发送给它们的用户才能私下看到它们。它将显示在请求页面上或作为通知给用户。
这是我的解决方案
//friendlist = NSString of fb id's
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
friendList, @"to",
nil];
[FBWebDialogs presentRequestsDialogModallyWithSession:nil
message:[NSString stringWithFormat:@"message!"]
title:@"title"
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 {
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"request"]) {
// User clicked the Cancel button
NSLog(@"User clicked cancel button.");
} else {
nslog("succesfully sent invites");
}
}
}
}
];