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, putAmityGif 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.
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 arenull 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.
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.
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 withgif 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.
Related Topics
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.