TwitterKit&带有视频的社交帖子推文

时间:2018-01-16 15:24:43

标签: swift video twitter social

我用于发布带有3个​​部分的TWTRComposerViewController - 文本,图像或视频 但后来我添加视频我有错误

"Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “System” in the folder “System”." UserInfo={NSURL=file:///, NSUserStringVariant=Folder, NSUnderlyingError=0x1c4856d10 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}"

我使用的网址类似于https://testDomain.com//...namefile.mp4

if (Twitter.sharedInstance().sessionStore.hasLoggedInUsers()) {

            do {
                 let url = URL(fileURLWithPath: ServerManager.sharedManager.twitterVideoShare)
                let composer = TWTRComposerViewController.init(initialText: "text", image: nil, videoURL: url)
                present(composer, animated: true, completion: nil)
            } catch  { print(error) }
        } else {
            Twitter.sharedInstance().logIn { session, error in
                if session != nil {
                    var datamp : Data = Data()

                    do {

                     let url = URL(fileURLWithPath: ServerManager.sharedManager.twitterVideoShare)
                let composer = TWTRComposerViewController.init(initialText: "text", image: nil, videoURL: url)
                        self.present(composer, animated: true, completion: nil)
                    } catch  { print(error) }
                }
            }
        }

0 个答案:

没有答案