问题
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
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/32789859/how-do-i-upload-video-in-a-tweet-in-an-ios-app-using-xcode