簡體   English   中英

無法使用[FBDialogs presentShareDialogWithParams]方法在牆上張貼

[英]Not able to post on wall using [FBDialogs presentShareDialogWithParams] method

我正在使用Facebook SDK 3.23.2的現有項目中進行工作。 我正在嘗試使用FBDialogs presentShareDialogWithParams方法在FB牆上共享數據。 共享對話框正在打開,但是在發布數據時錯誤狀態即將出現,我無法在牆上發布。

以下是我的代碼:

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)循環並顯示狀態為錯誤。 當我嘗試通過創建一個簡單的新項目來使用該方法時,雖然該方法仍然有效,但是在我的應用程序中卻無法使用...預先感謝

只需刪除.plist file我的Facebook顯示名稱即可。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM