iOS Swift: How to post a video to twitter with TwitterKit?

前端 未结 2 1532
不思量自难忘°
不思量自难忘° 2020-12-10 22:24

I haven\'t found relevant and up to date answer on SO.

Here is the code I\'m currently using, all requests are handled correctly but no video is posted ?

<         


        
2条回答
  •  半阙折子戏
    2020-12-10 23:11

    I sympathize with you about about Twitter's poor documentation. Find out what error you get.

    Below are implementation notes that I hope it helps:

    1. Twitter video requirement: https://dev.twitter.com/rest/public/uploading-media#videorecs.
    2. FINALIZE command verifies video file per Twitter video requirement before completing the upload.
    3. If you get "HTTP status 400 bad request" with response data having "Invalid or unsupported media, Reason: UnsupportedMedia." error after sending FINALIZE command, you need to verify your video file with Twitter video requirement.

    Check out my project https://github.com/mtrung/TwitterVideoUpload. I know it's in Obj-C but it works.

提交回复
热议问题