2015-09-09 28 views
0

我現有項目中,Facebook的SDK 3.23.2使用工作。我試圖通過使用FBDialogspresentShareDialogWithParams方法來分享FB牆數據。分享對話框打開,但同時公佈的數據錯誤狀態來&我無法張貼在牆上..無法使用張貼在牆上[FBDialogs presentShareDialogWithParams]方法

以下是我的代碼:

FBLinkShareParams *params = [[FBLinkShareParams alloc] init]; 
params.link = [NSURL URLWithString:@"https://developers.facebook.com/ios"]; 
params.picture = [NSURL 
        URLWithString:@"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"]; 
params.name = @"Facebook SDK for iOS"; 
params.caption = @"Build great social apps and get more installs."; 

if ([FBDialogs canPresentShareDialogWithParams:params]) 
{ 

    NSLog(@"in app"); 

    FBAppCall *call= [FBDialogs presentShareDialogWithParams:params clientState:nil handler:^(FBAppCall *call, NSDictionary *results, NSError *error) { 
          if(error) { 
           [ALToastView toastInView:self.view withText:@"error "]; 
           // If there's an error show the relevant message 

          } else { 
           // Check if cancel info is returned and log the event 
           if (results[@"completionGesture"] && 
            [results[@"completionGesture"] isEqualToString:@"cancel"]) { 


            [ALToastView toastInView:self.view withText:@"Inviting Via Facebook Cancelled"]; 
            NSLog(@"User canceled story publishing."); 
           } else { 

            [ALToastView toastInView:self.view withText:@"Inviting Via Facebook success"]; 
            // If the post went through show a success message 
           } 
          } 
         }]; 

的方法總是要if(error)循環&顯示狀態作爲錯誤。而當我試圖創建一個簡單的新項目,使用它,但它不是在我的應用程序的工作... 在此先感謝

+0

如果你有'error',請出示它。記錄它。 – Larme

+0

你是什麼意思記錄它? –

+0

什麼是錯誤信息?您可以在烤麪包片中展示它,但它可以幫助我們確定您的問題。 – Larme

回答

0

就在.plist file刪除我的Facebook的顯示名稱相同的方法工作。

+0

雅..this是我的查詢正確答案 –