// Display the requests dialog
[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 the 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 = [self 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);
}
}
}
}];
答案 0 :(得分:0)
为了澄清,请求不会显示在用户墙/ Feed中,而是显示在" globe"图标。但是,如果出现以下情况,请求将不会显示在通知中:
1)应用程序处于沙盒模式,接收者不是应用程序的开发人员。 (任何级别)
2)用户已禁用来自FB的应用/通知请求。 (https://www.facebook.com/settings?tab=notifications)
从个人经验来看,我还要补充一点,如果您过多地发送垃圾邮件或者帖子评分较低,Facebook往往不会显示请求通知。 (检查facebook.com/insights)