2013-06-04 48 views
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); 
      } 
     } 
    } 
}]; 

回答

0

要澄清,請求不會顯示在用戶牆/饋送中,而是作爲「globe」圖標下的通知顯示出來。但是,如果發生以下情況,請求將不會顯示在通知中:

1)應用程序處於沙盒模式,並且接收方不是應用程序的開發人員。 (任何級別)

2)用戶已禁用來自FB的應用程序/通知的請求。 (https://www.facebook.com/settings?tab=notifications

從個人經驗來看,我還會補充一點,如果你的垃圾郵件太多或者郵件評分較低,Facebook往往不會顯示通知。 (檢查facebook.com/insights

相關問題