Skip to main content
Let users share GIFs in their posts, on their own or beside photos and videos, so a post can carry a mood or a reaction that a still image can’t. Each GIF stays animated instead of being flattened into a photo. You keep the GIF experience you choose. Your app uses its own GIF provider, such as GIPHY, with that provider’s search and content filters, and social.plus stores only each GIF’s link and size. GIF posts show in feeds and post queries like any other post, you can filter for them by the gif data type, and moderators can remove one GIF or the whole post in the social.plus Console. Your app picks each GIF from its provider and passes the GIF link to the SDK. A post can hold only GIFs, or GIFs beside other media such as images and videos. The SDK does not upload the GIF and does not load it. Your app loads and shows the GIF.
GIF posts are available in the Android, iOS, and TypeScript SDKs. This page has samples for these three platforms only.

Parameters

GIF fields

The GIF host must be on the network’s link allowlist. See Allowlist Management. The SDK does not check the GIF rules. The SDK sends the values unchanged, and social.plus refuses a GIF that breaks a rule. See Errors.

Attachment rules

Create a GIF post

Pass the GIFs to the mixed media creation API. On Android, put AmityGif objects in the attachments set of createMixedAttachmentPost. On iOS, pass AmityGifData objects to AmityMixedMediaPostBuilder.setGifs(_:). On TypeScript, put GIF attachments in the attachments list of PostRepository.createMixedMediaPost. The caption text is optional.
To add images or videos to the same post, add the uploaded media to the Android attachments set. On iOS, also call setImages(_:) or setVideos(_:) on the builder. On TypeScript, add { type: 'image', fileId } or { type: 'video', fileId } entries to attachments. See Mixed Media Posts.

Read GIFs on a post

Read each GIF from the child posts of the post. The width and the height are null on Android, nil on iOS, and undefined on TypeScript when the post has no size.

Edit the GIFs of a post

Send the full list of attachments that the post keeps. social.plus matches each GIF by its link.
On iOS, edit a GIF post with AmityMixedMediaPostBuilder. Do not use AmityImagePostBuilder. That builder sends only the images, so the edit removes every GIF.
The examples below keep the first GIF and remove the other GIFs. They also send back every photo, video, file, and audio child, so a post with other media keeps it.
The iOS builder sends the post data in each edit. Set the caption on the builder so that the edit sends it.

Delete one GIF

Delete the GIF child post to remove one GIF. The parent post and its other GIFs stay. When you delete the last GIF, the post keeps its text. A post with no text stays empty. social.plus does not delete the post.

Query GIF posts

Use the post query with gif in the data types. The result holds GIF child posts. Read each GIF with getData() on Android, getGifInfo() on iOS, or the data of the child post on TypeScript. Set includeMixedStructure to true to also get GIFs from posts that hold other media.

GIF posts in feeds

Errors

The SDK returns a GIF error to your app unchanged. The SDK does not retry the request.

Notes

  • Realtime post events carry GIF child posts in the same shape as the API response. No GIF-specific event exists. See Social Realtime Events.

Mixed Media Posts

Combine GIFs with uploaded images and videos.

Query Posts

Filter feeds by data type and mixed structure.

GIF Comment

Add a GIF to a comment.