0

當我得到嘗試使用共享對話框與FB的iOS SDK v 3.17.0:定製OpenGraph方法發佈

Error : Error Domain=com.facebook.Facebook.platform Code=102 "The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)" UserInfo=0x176d43a0 {error_code=102, error_description=An error occurred during publishing., app_id=xxxxxxxxxxx, error_reason=The operation couldn’t be completed. (FBAPIErrorDomain error 2500.)}

此錯誤是由返回張貼到OpenGraph如果出現以下錯誤失敗presentShareDialogWithOpenGraphAction方法的處理程序回調。調用此方法時,會發生到FB應用程序的轉換,並在UI中顯示帖子的內容(儘管提供的照片短暫顯示然後消失)。我也看到在FB應用一個警告對話框,指出:

Oops, Something Went Wrong. There was a problem posting your status. We've logged the error and will look into it.

在FB應用按Post後,我的應用程序再次與上述錯誤信息打開。

我正在做的(縮寫)代碼如下。請注意,我的對象類型是gift,我的自定義方法是send,並且在開發者網站上似乎都設置了正確。任何幫助深表感謝。

id<FBGraphObject> object = [FBGraphObject openGraphObjectForPostWithType:@"myNamespace:gift"] 
             title:@"Gifter" 
             image:@"http://imgur.com/gallery/Omhe1V3" 
              url:@"http://www.myAppsUrl.com" 
            description:@"A gift for you"]; 
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject]; 
[action setObject:object forKey:@"gift"]; 

[action setTags:@[targetFacebookId]]; ///S.O. Note: The Id is obtained elsewhere. 

FBOpenGraphActionParams *params = [[FBOpenGraphActionParams alloc] init]; 
params.action = action; 
params.actionType = @"myNamespace:send"; 

// If the Facebook app is installed and we can present the share dialog 
if([FBDialogs canPresentShareDialogWithOpenGraphActionParams:params]) { 
    // Show the share dialog 
    [FBDialogs presentShareDialogWithOpenGraphAction:action 
              actionType:@"myNamespace:send" 
           previewPropertyName:@"gift" 
              handler:^(FBAppCall *call, NSDictionary *results, NSError *error) { 

               NSLog(@"Error : %@",error); 

              }]; 
} 
+0

所有參數你解決了嗎?也發生在我身上...... – Boaz 2014-10-08 18:09:46

回答

1

仔細查看您提供的參數。 FB不會告訴你什麼是錯,但只是返回這個一般錯誤。 我只是有同樣的問題,顯然我的命名空間是錯誤的。

所以我的建議 - 雙重和三重檢查你傳遞給FB