我如何从本地目录向facebook分享视频文件。
let dataTs: Data?
我尝试使用其他解决方案,但它们不起作用
var videoData: Data
do {
videoData = ServerManager.sharedManager.dataTs
print(videoData)
var strDesc : String
strDesc = "test Description"
let videoObject: [String : Any] = ["title": "Millions Poet", "description": strDesc]
let uploadRequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me/videos", parameters: videoObject, httpMethod: "POST")
uploadRequest.start(completionHandler: {(connection: FBSDKGraphRequestConnection, result: AnyObject, error: NSError) -> Void in
if error == error {
NSLog("Error")
} else {
NSLog("Success")
}
} as! FBSDKGraphRequestHandler)
} catch {
print(error)
}
答案 0 :(得分:1)
Swift 3代码
Relationship