简体   繁体   中英

How do I upload video in a tweet in an iOS app using XCode

I am new to iOS development and need to make a change to an iOS app I'm taking over to add video to a tweet. My current app UI allows the user to type in text for a tweet but I would be changing that to allow them to pick a video to upload along with the tweet similar to how the Twitter app works.

I see the Twitter API supports uploading video but I haven't been able to find any good examples on how to accomplish this using XCode and Objective-C. Any recommended approaches or tool kits I can leverage to accomplish this?

https://dev.twitter.com/rest/public/uploading-media

I had to roll my own solution. Check out my project https://github.com/mtrung/TwitterVideoUpload .

  • Light-weight due to using built-in Apple's Social framework to keep things light. No need to add extra frameworks such as TwitterKit and Fabric.
  • Support chunk upload.
  • Built-in support for user's credential retrieval

Thanks for the -1 that was helpful. So thought I found the answer with Fabric ( https://get.fabric.io/ ). The Android side supports image and video upload with a tweet but the iOS side does not (image only). It looks like you have to roll your own solution including building a video picker. Then you can use the Twitter REST API to upload the video. Not exactly what I was hoping for but it is doable.

This link shows Objective C and Swift code to do the video upload Share video on Twitter with Fabric API without composer iOS .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM