SDKsReact Native
Create a file message from a file
OpenIM React Native SDK guide for create a file message from a file.
Use createFileMessageFromFullPath() to create a message from a file on the device.
const message = await OpenIMSDK.createFileMessageFromFullPath({
filePath,
fileName: 'product-guide.pdf',
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | Full path to the file. |
fileName | string | Yes | File name shown to recipients. |
The call returns a MessageItem ready to send. When you use Send a message, the SDK uploads the local file.
Was this page helpful?