SDKsReact Native
Create image message from file
Construct an image message from a local file path using the OpenIM React Native SDK.
Construct an image message from a local image file on the device filesystem:
const message = await OpenIMSDK.createImageMessageFromFullPath(imagePath);Parameters
Supply imagePath as the absolute local filesystem path to the image file.
Return value
A resolved Promise returns the initialized MessageItem object with image details populated in pictureElem.
This method builds the message structure strictly in client memory; it does not dispatch messages to the server or trigger lifecycle events. After initialization, invoke Send message to deliver it to a conversation; the SDK automatically uploads the local image and generates thumbnail snapshots during transmission.
Was this page helpful?