/TwitterVideoUpload

Share/upload video to Twitter for iOS

Primary LanguageObjective-CMIT LicenseMIT

Overview

Light-weight share/upload video to Twitter for iOS

Usage

  • Copy 2 files TwitterVideoUpload.h and .m to your project.
  • Add 2 lines below to your view controller:
[[TwitterVideoUpload instance] setVideo:filename];
[[TwitterVideoUpload instance] upload:^(NSString* errorString) { ... }];
  • If success, completionHandler's errStr will be nil. If failed, errStr will contain REST response string.
  • To add tweet text along with video:
[TwitterVideoUpload instance].statusContent = @"...";

Optional usage

  • By default (account property is nil), upload: will try to get account before uploading. Optional: if you want to obtain account (ACAccount obj) manually, you can set yours as below:
[TwitterVideoUpload instance].account = aACAccountObj;

Notes

  • Twitter username + password must be provided to iOS Settings app
  • Twitter video requirement: https://dev.twitter.com/rest/public/uploading-media#videorecs.
  • FINALIZE command verifies video file per Twitter video requirement before completing the upload.
  • 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.

License

TwitterVideoUpload is available under the MIT license. See the LICENSE file for more info.