帖子没有在Facebook页面墙上显示 - Swit 4

时间:2018-05-28 09:36:37

标签: swift

我正在尝试使用图形API(page_id / photos)和iOS中的SWIFT 4上传Facebook商业页面墙上的帖子,但是当我看到Facebook页面回复后,我的帖子将显示在访客帖子而不是Facebook页面壁。我尝试传递页面访问令牌广告参数并提供manage_pages,publish_pages和publish_action,但仍在帖子中显示帖子。请帮帮我。

 let connection = FBSDKGraphRequestConnection()
            connection.add(FBSDKGraphRequest.init(graphPath: "/\(pageId)?fields=access_token", parameters: nil)) { (httpResponse, result, error) in

                if let error = error {
                   // print("Error: \(error)")
                } else {
                    let result = result as! [String:Any]
                    self.pageAccessToken = result["access_token"] as! String
                }
              }
            connection.start()

            let params = [
                "access_token":self.pageAccessToken,
                "caption":self.itemName.text! + " - $ " + self.itemcost + " " + self.width + "w x " + self.depth + "d x " + self.height + "h",
                "url":imageURL,
                "appId":FBSDKAccessToken.current().appID,
                "uid":FBSDKAccessToken.current().userID]

            FBSDKGraphRequest.init(graphPath: "\(pageId)/photos", parameters: params, httpMethod: "POST").start(completionHandler: { (connection, result, error) -> Void in
                if let error = error {
                    print("Error: \(error)")
                } else {
                    print("Success")
                    print(result)
}

0 个答案:

没有答案