3
// 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);
             }
         }
     }
 }];
4

1 回答 1

0

澄清一下,请求不会显示在用户墙/提要中,而是作为“地球”图标下的通知。但是,如果出现以下情况,请求将不会显示在通知中:

1) 应用处于沙盒模式,接收者不是应用的开发者。(任何级别)

2) 用户已禁用来自 FB 的应用程序/通知请求。(https://www.facebook.com/settings?tab=notifications

根据个人经验,我还要补充一点,如果您发送过多垃圾邮件或帖子评分较低,Facebook 往往不会显示请求通知。(查看facebook.com/insights

于 2013-12-16T08:47:35.727 回答