ARTICLE AD BOX
I am developing a custom Android keyboard app (KBoard) in Kotlin that allows users to send stickers directly into WhatsApp chats. Static stickers work fine, but animated stickers always appear as static images once they reach the chat.
What I’ve tried:
Exported stickers as animated WebP (512×512 px, transparent, > 500 KB).
Used FileProvider to generate a content:// URI.
Committed content via InputConnectionCompat.commitContent with MIME type "image/webp.wasticker".
Verified that WhatsApp accepts the MIME type and the commitContent call succeeds.
Cleared WhatsApp cache to avoid old flattened versions.
Code snippet:
fun sendAnimatedStickerToWhatsApp(uri: Uri, mimeType: String = "image/webp.wasticker") { val editorInfo = currentInputEditorInfo ?: return val inputConnection = currentInputConnection ?: return if (EditorInfoCompat.getContentMimeTypes(editorInfo).contains(mimeType)) { val clipDescription = ClipDescription("WhatsApp Sticker", arrayOf(mimeType)) val inputContentInfo = InputContentInfoCompat(uri, clipDescription, null) InputConnectionCompat.commitContent( inputConnection, editorInfo, inputContentInfo, InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION, null ) }Problem: Even though the commit succeeds, WhatsApp flattens the animated WebP into a static sticker.
Does WhatsApp require animated stickers to be sent via the Cloud API Media API + Messages API (with a media_id) for them to animate, rather than via commitContent from a keyboard?
If commitContent is supported for animated stickers, what exact MIME type or metadata must be included to prevent flattening?
Are there additional requirements (looping flags, ANIM/ALPH chunks in WebP, metadata in contents.json) that must be set for WhatsApp to recognize the sticker as animated?
Is it possible for a third‑party keyboard app to send animated stickers that animate inline in consumer WhatsApp chats, or is this only supported through the Business Cloud API?
