iOS上失败的iOS分享

时间:2017-08-19 14:14:29

标签: ios swift facebook facebook-graph-api

客户要求是我必须与描述共享图像,根据当前的Facebook政策我无法与描述共享图像所以我正在使用

FBSDKShareOpenGraphObject

以下是我的代码

  let ph = FBSDKSharePhoto(image: UIImage(named:"testimage"), userGenerated: true)

        //These properties you will get via the Get Code menu in facebook app dashboard (where you set up your Action, Object and Custom Story)
        let properties: [NSObject : AnyObject] = ["og:type": "xxxx:quote", "og:title": "xxxx", "og:description": "Thank you  ds sds dsd sd d ds لت"]

        //Create the Open Graph object
        let object: FBSDKShareOpenGraphObject = FBSDKShareOpenGraphObject(properties: properties)

        //Create the action itself
        let action: FBSDKShareOpenGraphAction = FBSDKShareOpenGraphAction()

        //This comes from the same Get Code menu, but when you select to get the code for the action
        action.actionType = "xxxx:share"
        action.setObject(object, forKey: "xxxx:quote")

        //Set the image as an Array, as here you can actually post more than one image
        action.setArray([ph], forKey: "image")

        //Create the content and add the action to it
        let content: FBSDKShareOpenGraphContent = FBSDKShareOpenGraphContent()
        content.action = action
        content.previewPropertyName = "xxxx:quote"

        //Execute the Share Dialog
        FBSDKShareDialog.showFromViewController(self, withContent: content, delegate: self)

当我尝试发布时,我收到了以下错误

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

我试图提交应用程序以便在Facebook上查看以下内容

Your app is using the Share plugin to share content to Facebook, so you don't need to submit for review. Publish_actions is only for posting through the Graph API. See our sharing docs for more info on plugins. 

请帮助我完成发布图片和文字的要求

0 个答案:

没有答案