Search code examples
androidreact-nativeandroid-softkeyboardandroid-7.1-nougatandroid-textinputedittext

Image keyboard support in React Native


Android documentation states that:

With Android 7.1 (API level 25), the Android SDK includes the Commit Content API, which provides a universal way for IMEs to send images and other rich content directly to a text editor in an app.

However, when I use the React Native's TextInput component and select a GIF from Android's keyboard, I receive the following message (see screenshot):

This text field does not support GIF insertion from the keyboard.

This text field does not support GIF insertion from the keyboard.

How can I add support for this functionality to a React Native app? Ideally I'd like a component that provides a callback to handle the URI received by commitContent().


Solution

  • There's a pull request that adds support from 3 months ago. I'm not clear why it isn't merged at this point... https://github.com/facebook/react-native/pull/26088