SDKsReact Native
Create a contact card message
OpenIM React Native SDK guide for create a contact card message.
Use createCardMessage() to create a user contact-card message.
const message = await OpenIMSDK.createCardMessage({
userID: 'user-002',
nickname: 'Alex',
faceURL: 'https://example.com/avatar.png',
ex: '',
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userID | string | Yes | User ID represented by the card. |
nickname | string | Yes | Nickname shown on the card. |
faceURL | string | Yes | Avatar URL shown on the card. |
ex | string | Yes | Card extension data. Pass an empty string when it is not used. |
The call returns a MessageItem ready to send. message.cardElem contains the card information passed during creation.
Was this page helpful?