显示Facebook Graph Api的分享对话框 - iOS

时间:2015-11-13 12:26:44

标签: ios iphone xcode facebook facebook-opengraph

我正在尝试共享我在开放图表部分的对象标签上创建的对象。

        FBSDKGameRequestContent *gameRequestContent = [[FBSDKGameRequestContent alloc] init];
        gameRequestContent.message = message;
        gameRequestContent.title = title;
        gameRequestContent.recipients = @[@"400098323516165"];
        gameRequestContent.actionType = actionType;
        gameRequestContent.objectID = @"123456"; //I also tried by the name : bingoclimb:life
        FBSDKGameRequestDialog* dialog = [[FBSDKGameRequestDialog alloc] init];
        dialog.frictionlessRequestsEnabled = YES;
        dialog.content = gameRequestContent;
        dialog.delegate = self;
        [dialog show];

我的对象部分如下所示:

enter image description here

如果我尝试使用此代码(带有id),我会收到以下错误:

  

错误Domain = com.facebook.sdk.share Code = 2“操作不能   完成。 (com.facebook.sdk.share错误2.)“UserInfo = 0x170c6cdc0   {com.facebook.sdk:FBSDKErrorDeveloperMessageKey =对不起,这个功能   目前无法使用:处理此错误时出错   请求。请稍后再试。}

如果我尝试将objectId作为名称,我会收到以下错误:

  

错误Domain = com.facebook.sdk.share Code = 100“操作无法执行   完成。 (com.facebook.sdk.share error 100.)“   的UserInfo = 0x17066eb40   {com.facebook.sdk:FBSDKErrorDeveloperMessageKey =无效的费用。}

注意:用户具有publish_actions权限。

此外,当我从“对象的示例代码”中复制创建代码并运行它时,我收到以下错误:

  

错误Domain = com.facebook.sdk.share Code = 201“操作无法执行   完成。 (com.facebook.sdk.share error 201.)“   的UserInfo = 0x17046a240   {com.facebook.sdk:FBSDKErrorDeveloperMessageKey =创建Open时出错   图形对象:错误Domain = com.facebook.sdk.core Code = 8“操作   无法完成。 (com.facebook.sdk.core错误8.)“   的UserInfo = 0x1701accc0   {NSRecoveryAttempter = LT; _FBSDKTemporaryErrorRecoveryAttempter:   0x170016150>,com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode = 1,   NSLocalizedRecoverySuggestion =请服务器暂时忙   再试一次。,com.facebook.sdk:FBSDKErrorDeveloperMessageKey =未知   发生了错误。,   com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey = 500,   com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey = 1,   NSLocalizedRecoveryOptions =(       OK),com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey = {       body = {           error = {               code = 1;               “fbtrace_id”=“BGhIEBfOI + b”;               message =“发生了未知错误。”;               type = OAuthException;           };       };       代码= 500; },NSUnderlyingError = 0x17005abb0“操作无法完成。(com.facebook.sdk.core错误8。)”}

0 个答案:

没有答案