I have a UIActivityViewController
sharing an object that
- conforms to the
UIActivityItemSource
protocol and - offers an animated GIF file by returning an
NSURL
of a .gif file andCFBridgingRelease(kUTTypeGIF)
in the appropriate methods.
I see the GIF moving in the Simulator if I share one of my objects in a new Mail message. If I try tweeting the same thing, a frame of the image is attached to the tweet, but it's uploaded as a still image.
Do I need to wait for Apple to update UIActivityTypePostToTwitter
in a future iOS version, or have I missed a workaround you've seen somewhere? (I realize this case isn't using anything from the list "Twitter.com, Android and iPhone [app]". This is probably a futile plea.)
Homework already done:
- I know that the Twitter activity type can also work with an ALAsset object, and people get animated gifs into and out of Saved Photos by keeping their data wrapped up in ALAssets, but I want to be able to tweet these gifs without touching the Camera Roll, if possible.
- I checked NSHipster.
- I tried returning an
NSData
object instead of anNSURL
for my local .gif file on a tip from Lyndsey about the Twitter API. No change. I tried returning
kUTTypeData
instead ofkUTTypeGIF
as thedataTypeIdentifierForActivityType
after seeing this in the Twitter API docs:The image passed should be the raw binary of the image or binary base64 encoded, no need to otherwise encode or escape the contents as long as the Content-Type is set appropriately (when in doubt: “application/octet-stream”).
but then no image appeared in my tweet.
Thanks!