Using React Native
Last updated
Was this helpful?
Last updated
Was this helpful?
To get started, you will need to install MinChat React SDK in your React app.
Import the MinChatProvider
at the top of your file.
Wrap your chat app with the MinChatProvider
passing the MINCHAT_API_KEY
as well as the user as props. The API Key can be found on the .
Import the useMinChat
hook at the top of your file.
You can now access the MinChat SDK object.
before you can start a conversation with another user, the user would first need to be created.
You can fetch an already existing user using either their username or their id.
A Conversation(Chat) is a place for two or more users to chat. That could mean a simple direct message between users, or it might be something fancier. MinChat works with all kinds of conversations, from group chats to one on one conversations.
A Conversation(Chat) is a place for two or more users to chat. That could mean a simple direct message between users, or it might be something fancier. MinChat works with all kinds of conversations, from group chats to one on one conversations.
Messages retrieved in a conversation are paginated to 25 messages at a time.
To send a message, call the sendMessage(...)
function from useMessages
hook.
New messages received are automatically added to the messages
variable of useMessages(...)
You can get a list of the conversations of the current user. conversations retrieved are paginated to 25 messages at a time. New conversations started by other users or messages sent to conversations that are on a different page are automatically added to the chats
array.
This concludes our setup instructions for our most basic form of integration. In this short guide, you've taken your React Native app to the next level with powerful user-to-user chat. You also learned more about the fundamentals of MinChat, and how it all fits together. Most importantly, you've built a starting point to try out all the features MinChat offers.
You can view more details about the currentUser parameters .
In MinChat, a is a person that uses your app. Typically, you will have one MinChat for each user in your own database.
Usually, you would create users based on the data from your database. A is represented by a JSON object.
You can view more details about the user parameters .
There's not much point in a chat app with only one person using it, so let's create another .
You can view more details about the response and parameters .
You can view more details about the response and parameters .
You can view more details about the response and parameters .
You can view more details about the response and parameters .
You can view more details about the response and parameters .
For more additional features, view the .