{"id":37685,"date":"2025-03-11T16:04:52","date_gmt":"2025-03-11T10:34:52","guid":{"rendered":"https:\/\/www.mirrorfly.com\/blog\/?p=37685"},"modified":"2026-04-09T16:38:26","modified_gmt":"2026-04-09T11:08:26","slug":"build-a-chat-app-with-react-native-gifted-chat","status":"publish","type":"post","link":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/","title":{"rendered":"Build a Chat App With React Native Gifted Chat (2026 Guide)"},"content":{"rendered":"\n<p>Building your own custom chat app with a React Native Gifted Chat solution ensures that you deploy your platform quickly without spending months writing codes.&nbsp;<\/p>\n\n\n\n<p>With a pre-built CPaaS solution like MirrorFly, you don&#8217;t even need tech skills to build a messaging app in React Native Gifted Chat.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Follow_these_8_steps_to_build_your_app\"><\/span><strong>Follow these 8 steps to build your app:<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list list-highlight\">\n<li><strong>Step 1<\/strong>: Prerequisites and Requirements<\/li>\n\n\n\n<li><strong>Step 2<\/strong>: Setting Up the React Native Project<\/li>\n\n\n\n<li><strong>Step 3:<\/strong> Installing Dependencies<\/li>\n\n\n\n<li><strong>Step 4:<\/strong> Building Login and Registration Screens<\/li>\n\n\n\n<li><strong>Step 5:<\/strong> Setting Up Firebase for User Authentication<\/li>\n\n\n\n<li><strong>Step 6:<\/strong> Building the Chat Screen with react-native-gifted-chat<\/li>\n\n\n\n<li><strong>Step 7:<\/strong> Integrating MirrorFly Chat SDK for Android<\/li>\n\n\n\n<li><strong>Step 8:<\/strong> Integrating with React Native<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_a_React_Native_Gifted_Chat\"><\/span><strong>What is a React Native Gifted Chat?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>React Native Gifted Chat<\/strong> is an open-source library. It gives you a complete <strong>chat user interface (UI) <\/strong>for building messaging apps in React Native.&nbsp;<\/p>\n\n\n\n<p>You\u2019ll need to write every line of code yourself to<a href=\"https:\/\/www.mirrorfly.com\/blog\/build-a-react-native-chat-app\/\"> build a reactnative chat app<\/a>. Or, at least a minimal coding when you go with a pre-built <a href=\"https:\/\/www.mirrorfly.com\/react-native-chat-sdk.php\">react native SDK<\/a>.&nbsp;<\/p>\n\n\n\n<p><strong>But<\/strong>, Gifted chat takes away that hassle!&nbsp;<\/p>\n\n\n\n<p><strong>React Native Gifted Chat<\/strong> gives you a set of pre-built, customizable components. All you need to do is plug and play with these components to build the exact app you desire. Consequently, with <strong>Gifted Chat for React Native<\/strong>, you can complete your app development faster, launch it before your deadline, and provide your users with a superb, real-time chat experience.<\/p>\n\n\n\n<p><strong>Is Gifted Chat only for React Native? Or does it work with other technologies?<\/strong><\/p>\n\n\n\n<p>Gifted Chat is designed primarily for <a href=\"https:\/\/www.mirrorfly.com\/blog\/best-react-native-apps\/\">React Native apps<\/a>, which means it works on:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>iOS and Android:<\/strong> It\u2019s built for <a href=\"http:\/\/amasty.com\/mobile-app-development-service.html\">mobile apps<\/a>, ensuring a consistent look and feel across both platforms.<\/li>\n\n\n\n<li><strong>Web (with react\u2011native\u2011web):<\/strong> With some additional configuration, you can also deploy a web version of your chat app.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\"><strong>Quick-fact:<\/strong><br><br><strong>Why the name \u201cGifted Chat\u201d?&nbsp;<\/strong><br><br>The name \u201cGifted Chat\u201d reflects its goal: to \u201cgift\u201d developers a feature-rich, ready-to-use solution for chat interfaces. Here\u2019s why the name is a really good fit for this library:<br>1. It comes bundled with many features.<br>2. Reduces so much work that a developer has to do.<br>3. Even though it\u2019s pre-built, you can customize the features as much as you want.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Should_You_Go_For_React_Native_Gifted_Chat\"><\/span><strong>Why Should You Go For React Native Gifted Chat?&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Using React Native Gifted Chat can be a smart choice for a good number of reasons:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Gifted Chat <strong>speeds up your chat app development<\/strong> with its pre-built components. You can build prototypes and MVPs instantly using the plug and play features.&nbsp;<\/li>\n\n\n\n<li>You need not worry about elements being pre-built. It will not affect your <strong>freedom to customize<\/strong> in any way. Because you can simply override almost every component to make sure the design fits your brand needs.&nbsp;<\/li>\n\n\n\n<li>You can combine GiftedChat react native with any backend services like <strong>Firebase service<\/strong> or <a href=\"https:\/\/www.mirrorfly.com\/chat-api-solution.php\"><strong>MirrorFly\u2019s messaging components<\/strong><\/a> to create real-time chat capabilities.&nbsp;<\/li>\n\n\n\n<li>Whether you build it on iOS, Android, or react gifted chat web , the Chat UI will behave the same in all platforms, giving your users a consistent brand experience.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Are_The_Common_Uses_Of_React_Native_Gifted_Chat\"><\/span><strong>What Are The Common Uses Of React Native Gifted Chat?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Gifted Chat makes building chat apps easier than ever. The library is used for various types of messaging apps. It is primarily used for:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>One-on-One Chat\/ Direct messaging:<\/strong><strong><br><\/strong>You can quickly build private conversations between two users.<\/li>\n\n\n\n<li><strong>Group Chat:<\/strong><strong><br><\/strong>For apps that need to<strong> <\/strong>handle conversations between multiple users and to efficiently support features like avatars, load earlier messages (pagination), and typing indicators.<\/li>\n\n\n\n<li><strong>Prototyping &amp; MVPs:<\/strong><strong><br><\/strong>Want to quickly test chat features without a huge upfront investment in design or custom coding? Go for Gifted Chat!<\/li>\n\n\n\n<li><strong>Real-Time Messaging:<br><\/strong>If you already have a business app and are looking to integrate a custom back-end messaging solution to app messaging capabilities.&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"React-native-gifted-chat_Key_Props\"><\/span><strong>React-native-gifted-chat Key Props<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Alright, before we get into development, let&#8217;s explore some of the essential props that React Native Gifted Chat provides:<\/p>\n\n\n\n<figure class=\"wp-block-table custom-table pink-color\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>react-native-gifted-chat Props<\/strong><\/th><th><strong>Characteristics<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>messages (array)<\/strong><\/td><td>An array of message objects that get displayed in the chat<\/td><\/tr><tr><td><strong>text (string)<\/strong><\/td><td>Controls the text in the input field<\/td><\/tr><tr><td><strong>isTyping (bool)<\/strong><\/td><td>Manages the typing indicator state (default: false)<\/td><\/tr><tr><td><strong>timeFormat (string)&nbsp;<\/strong><\/td><td>Determines the time format (default: &#8216;LT&#8217;)<\/td><\/tr><tr><td><strong>dateFormat (string)&nbsp;<\/strong><\/td><td>Sets the date format (default: &#8216;ll&#8217;)<\/td><\/tr><tr><td><strong>placeholder (string)&nbsp;<\/strong><\/td><td>Text displayed when the input field is empty (default: &#8216;Type a message&#8230;&#8217;)<\/td><\/tr><tr><td><strong>user (object)&nbsp;<\/strong><\/td><td>Contains user information like {_id, name, avatar}<\/td><\/tr><tr><td><strong>messageIdGenerator (function)&nbsp;<\/strong><\/td><td>Generates unique IDs for new messages (default: UUID v4)<\/td><\/tr><tr><td><strong>onSend (function)<\/strong><\/td><td>A callback function that\u2019s called when a message is sent. You can use this to update your backend or local state.<\/td><\/tr><tr><td><strong>loadEarlier (boolean)<\/strong><\/td><td>Enables a button to load earlier messages.<\/td><\/tr><tr><td><strong>onLoadEarlier (function)<\/strong><\/td><td>A callback that gets triggered when the user taps the \u201cload earlier messages\u201d button.<\/td><\/tr><tr><td><strong>isLoadingEarlier (boolean)<\/strong><\/td><td>Indicates whether earlier messages are currently being loaded.<\/td><\/tr><tr><td><strong>renderAvatar<\/strong><\/td><td>Customize the avatar appearance.<\/td><\/tr><tr><td><strong>renderBubble&nbsp;&nbsp;<\/strong><\/td><td>Change how message bubbles look.<\/td><\/tr><tr><td><strong>renderInputToolbar&nbsp;<\/strong><\/td><td>Replace the default input toolbar with your own component.<\/td><\/tr><tr><td><strong>renderCustomView&nbsp;<\/strong><\/td><td>Add any additional custom views inside the chat bubble.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><br><strong>MirrorFly Pro Tip<\/strong><br><br>Use a back-end service like Firebase, <a href=\"https:\/\/www.mirrorfly.com\/\">MirrorFly,<\/a> or your own server. They take care of logins, saving messages, and real-time updates, so you can easily create a fun and smooth chat app!<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"751\" height=\"360\" src=\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2025\/03\/MF_Steps-to-guide-React-Native-07.png\" alt=\"react native chat app \" class=\"wp-image-37758\" srcset=\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2025\/03\/MF_Steps-to-guide-React-Native-07.png 751w, https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2025\/03\/MF_Steps-to-guide-React-Native-07-350x168.png 350w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><figcaption class=\"wp-element-caption\"><strong>Steps to build a chat app with react-native-gifted-chat<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Steps_to_Build_a_Chat_App_with_React_Native_Gifted_Chat\"><\/span><strong>8 Steps to Build a Chat App with React Native Gifted Chat<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this section, you\u2019ll learn how to set up your React Native project to integrate<a href=\"https:\/\/www.mirrorfly.com\/chat-features.php\"> advanced real\u2011time messaging features<\/a> with MirrorFly. Follow along to learn every detail of the code and configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Prerequisites and Requirements<\/strong><\/h3>\n\n\n\n<p>Before you begin, you\u2019ll have to make sure the following components installed on your development machine:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Node.js<\/strong> and <strong>npm<\/strong> (or Yarn)<\/li>\n\n\n\n<li><strong>React Native CLI<\/strong><\/li>\n\n\n\n<li><strong>Android Studio<\/strong> (for Android-specific integration)<\/li>\n\n\n\n<li><strong>Java 7+<\/strong> (for MirrorFly SDK)<\/li>\n\n\n\n<li><strong>Gradle 4.1.0+<\/strong> (required for Android projects)<\/li>\n<\/ul>\n\n\n\n<p><strong>MirrorFly Chat SDK for Android Requirements:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Android Lollipop 5.0 (API Level 21)<\/strong> or higher<\/li>\n\n\n\n<li><strong>targetSdkVersion\/compileSdkVersion:<\/strong> 34 or above (for SDK version 7.11.4+ due to Android 14 migration)<\/li>\n<\/ul>\n\n\n\n<p>Additionally, register for a <a href=\"https:\/\/www.mirrorfly.com\/contact-sales.php\">MirrorFly account<\/a> to obtain your SDK License Key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Setting Up the React Native Project<\/strong><\/h3>\n\n\n\n<p>Open your terminal and create a new React Native project:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>npx react-native init GiftedChatApp\n<\/code><\/code><\/pre>\n\n\n\n<p>This command initializes a new project called <strong>GiftedChatApp<\/strong>. It sets up the required folder structure (including<strong> android\/, ios\/<\/strong>, and a default <strong>App.js<\/strong>), enabling you to start coding your application immediately.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Installing Dependencies<\/strong><\/h3>\n\n\n\n<p>Navigate to your project directory&nbsp;<\/p>\n\n\n\n<p><strong>cd \/path\/to\/your\/project<\/strong><\/p>\n\n\n\n<p>Run the following command to install all the necessary packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install @react-navigation\/native \n@react-navigation\/stack react-native-gifted-chat\nreact-native-reanimated react-native-gesture-handler \nreact-native-screens react-native-safe-area-context \n@react-native-community\/masked-view react-native-vector-icons<\/code><\/pre>\n\n\n\n<p>The packages you&#8217;ll install include libraries for smooth navigation, a friendly chat interface, and enhanced animations. They let you manage app screens easily, handle touch gestures, ensure proper content display on different devices, and even add cool icons to your project.<\/p>\n\n\n\n<p>This is what exactly each package will do:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>@react-navigation\/native<\/strong>: Core library for handling navigation.<\/li>\n\n\n\n<li><strong>@react-navigation\/stack<\/strong>: Provides stack-based navigation.<\/li>\n\n\n\n<li><strong>react-native-gifted-chat<\/strong>: A customizable chat UI component.<\/li>\n\n\n\n<li><strong>react-native-reanimated<\/strong>: Enhances animations in your app.<\/li>\n\n\n\n<li><strong>react-native-gesture-handler<\/strong>: Improves gesture handling.<\/li>\n\n\n\n<li><strong>react-native-screens<\/strong>: Optimizes native screen performance.<\/li>\n\n\n\n<li><strong>react-native-safe-area-context:<\/strong> Manages safe area boundaries.<\/li>\n\n\n\n<li><strong>@react-native-community\/masked-view<\/strong>: Enables masking views.<\/li>\n\n\n\n<li><strong>react-native-vector-icons:<\/strong> Offers a wide range of icons for your app.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Building Login and Registration Screens<\/strong><\/h3>\n\n\n\n<p>Create two separate screens: one for login and one for registration. These screens use <strong>React Native Elements<\/strong> for a polished UI.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>4.1. Login Screen<\/strong><\/h4>\n\n\n\n<p>Create a file named<strong> LoginScreen.js<\/strong>:<\/p>\n\n\n\n<p><strong>4.1.1. Imports and Setup<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ LoginScreen.js\n\nimport React, { useState } from 'react';\n\nimport { View, StyleSheet } from 'react-native';\n\nimport { Input, Button, Text } from 'react-native-elements';<\/code><\/pre>\n\n\n\n<p>In this first section, we will import all the necessary modules and components.&nbsp;<\/p>\n\n\n\n<p>We bring in React and the <strong>useState<\/strong> hook to allow us to manage state within our functional component.&nbsp;<\/p>\n\n\n\n<p>The <strong>View<\/strong> and <strong>StyleSheet<\/strong> components from React Native are used for layout and styling, while the<strong> Input<\/strong>, <strong>Button<\/strong>, and <strong>Text<\/strong> components from the <strong>react-native-elements<\/strong> library help build a clean and easy-to-use user interface.<\/p>\n\n\n\n<p><strong>4.1.2. Component Definition and State Variables<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const LoginScreen = ({ navigation }) =&gt; {\n\n&nbsp;&nbsp;\/\/ State hooks to store user inputs and errors\n\n&nbsp;&nbsp;const &#91;email, setEmail] = useState('');\n\n&nbsp;&nbsp;const &#91;password, setPassword] = useState('');\n\n&nbsp;&nbsp;const &#91;error, setError] = useState(null);<\/code><\/pre>\n\n\n\n<p>Here, we define the <strong>LoginScreen<\/strong> component as a functional component that accepts a <strong>navigation<\/strong> prop, which is essential for moving between screens in the app.&nbsp;<\/p>\n\n\n\n<p>Within the component, we initialize three state variables using <strong>useState<\/strong>: one for storing the email, another for the password, and a third for any error messages that might occur during the login process.&nbsp;<\/p>\n\n\n\n<p>This setup allows the component to reactively update and display user inputs as well as any errors that might happen.<\/p>\n\n\n\n<p><strong>4.1.3. Login Handler Function<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Handler for login button press\n\n&nbsp;&nbsp;const handleLogin = async () =&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;try {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Here you would call Firebase's signInWithEmailAndPassword function\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ await signInWithEmailAndPassword(auth, email, password);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ On successful login, navigate to the Chat screen.\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;navigation.navigate('Chat');\n\n&nbsp;&nbsp;&nbsp;&nbsp;} catch (err) {\n\n&nbsp;&nbsp;&nbsp;\/\/ Capture and display errors (e.g., invalid credentials)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setError(err.message);\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;};<\/code><\/pre>\n\n\n\n<p>Next, we will be using the <strong>handleLogin<\/strong> function, which is an asynchronous function triggered when the user taps the &#8220;Login&#8221; button.&nbsp;<\/p>\n\n\n\n<p>Inside the function, a try-catch block is used to manage the login process.&nbsp;<\/p>\n\n\n\n<p>In a complete app, you would integrate Firebase\u2019s <strong>signInWithEmailAndPassword <\/strong>method to authenticate the user, but in this example, that part is commented out.&nbsp;If the login attempt is successful, the user is directed to the &#8216;Chat&#8217; screen. Should an error occur (for instance, if the credentials are incorrect), the error is caught and the error message is stored in the <strong>error<\/strong> state so it can be displayed to the user.<\/p>\n\n\n\n<p><strong>4.1.4. Building the UI Layout<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>return (\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;View style={styles.container}&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Text h3 style={styles.header}&gt;Login&lt;\/Text&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Input\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder=\"Email\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;leftIcon={{ type: 'material', name: 'email' }}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value={email}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onChangeText={setEmail}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Input\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder=\"Password\"\n\nleftIcon={{ type: 'material', name: 'lock' }}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;secureTextEntry\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value={password}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onChangeText={setPassword}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{error &amp;&amp; &lt;Text style={styles.error}&gt;{error}&lt;\/Text&gt;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Button title=\"Login\" onPress={handleLogin} \/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Button\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title=\"Register\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type=\"outline\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onPress={() =&gt; navigation.navigate('Register')}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/View&gt;\n\n&nbsp;&nbsp;);\n\n};<\/code><\/pre>\n\n\n\n<p>The<strong> return<\/strong> statement renders a View container that applies the defined styles, ensuring a neat layout with proper spacing. Inside the container, a header labeled &#8220;Login&#8221; is displayed using the <strong>Text<\/strong> component, followed by two input fields: one for the user&#8217;s email and another for the password.&nbsp;<\/p>\n\n\n\n<p>The password field uses the <strong>secureTextEntry<\/strong> prop to hide the text for privacy. An error message is conditionally rendered if any error exists, allowing the user to see feedback in case something goes wrong.&nbsp;<\/p>\n\n\n\n<p>Finally, two buttons are provided: one to trigger the <strong>handleLogin<\/strong> function and log the user in, and another to navigate to the registration screen if the user does not yet have an account.<\/p>\n\n\n\n<p><strong>4.1.5. Styling<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const styles = StyleSheet.create({\n\n&nbsp;&nbsp;container: { flex: 1, justifyContent: 'center', padding: 20 },\n\n&nbsp;&nbsp;header: { marginBottom: 20, textAlign: 'center' },\n\n&nbsp;&nbsp;error: { color: 'red', textAlign: 'center', marginBottom: 10 }\n\n});<\/code><\/pre>\n\n\n\n<p>The <strong>container<\/strong> style ensures that the view takes up the full screen, centers its children vertically, and has a padding of 20 for proper spacing.&nbsp;<\/p>\n\n\n\n<p>The <strong>header<\/strong> style centers the header text and provides a margin at the bottom to separate it from the rest of the content.&nbsp;<\/p>\n\n\n\n<p>The <strong>error<\/strong> style is applied to any error messages, setting the text color to red, centering it, and adding a margin below for clarity.<\/p>\n\n\n\n<p><strong>4.1.6. Exporting the Component<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export default LoginScreen;<\/code><\/pre>\n\n\n\n<p>Finally we will explore the&nbsp; <strong>LoginScreen<\/strong> component, making it available for use in other parts of the app.&nbsp;<\/p>\n\n\n\n<p>This allows the login screen to be integrated into the navigation stack and used wherever needed within your project.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>4.2. Registration Screen<\/strong><\/h4>\n\n\n\n<p>Create a file named <strong>RegisterScreen.js<\/strong>:<\/p>\n\n\n\n<p><strong>4.2.1. Imports and Setup<\/strong><\/p>\n\n\n\n<p>In this first section, we\u2019ll import all the required modules and components.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ RegisterScreen.js\n\nimport React, { useState } from 'react';\n\nimport { View, StyleSheet } from 'react-native';\n\nimport { Input, Button, Text } from 'react-native-elements';\n\nimport { auth } from '.\/firebase'; \/\/ Ensure the correct path to your firebase config<\/code><\/pre>\n\n\n\n<p>We bring in <strong>React<\/strong> and the <strong>useState<\/strong> hook to build a functional component with state management.&nbsp;<\/p>\n\n\n\n<p>The <strong>View<\/strong> and <strong>StyleSheet<\/strong> components from React Native help us create and style the layout, while the <strong>Input, Button<\/strong>, and<strong> Text<\/strong> components from <strong>react-native-elements<\/strong> provide a user-friendly interface.&nbsp;Additionally, we import the <strong>auth<\/strong> object from our Firebase configuration, which is used to handle user authentication.<\/p>\n\n\n\n<p><strong>4.2.2. Component Definition and State Variables<\/strong><\/p>\n\n\n\n<p>Next, let us define the <strong>RegisterScreen<\/strong> component as a functional component that accepts a <strong>navigation<\/strong> prop, which allows us to move between screens in the app.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const RegisterScreen = ({ navigation }) =&gt; {\n\n&nbsp;&nbsp;const &#91;email, setEmail] = useState('');\n\n&nbsp;&nbsp;const &#91;password, setPassword] = useState('');\n\n&nbsp;&nbsp;const &#91;error, setError] = useState(null);<\/code><\/pre>\n\n\n\n<p>Here, we set up three state variables using<strong> useState<\/strong>: one to store the user&#8217;s email, another to store the password, and a third for any error messages that might occur during the registration process.&nbsp;<\/p>\n\n\n\n<p>This setup enables the component to dynamically update based on user input and to display any error feedback.<\/p>\n\n\n\n<p><strong>4.2.3. Register Handler Function<\/strong><\/p>\n\n\n\n<p>This section defines the <strong>handleRegister<\/strong> function, which is called when the user taps the &#8220;Register&#8221; button.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Handler for registration button press\n\n&nbsp;&nbsp;const handleRegister = async () =&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;try {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Create a new user using Firebase authentication\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;await auth.createUserWithEmailAndPassword(email, password);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;navigation.navigate('Chat');\n\n&nbsp;&nbsp;&nbsp;&nbsp;} catch (err) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setError(err.message);\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;};<\/code><\/pre>\n\n\n\n<p>The function is asynchronous because it interacts with Firebase&#8217;s authentication service. Inside the try-catch block, the code attempts to create a new user account using the provided email and password with Firebase&#8217;s <strong>createUserWithEmailAndPassword<\/strong> method.&nbsp;<\/p>\n\n\n\n<p>If the registration is successful, the user is navigated to the &#8216;Chat&#8217; screen. If an error occurs during the process such as an invalid email format or a weak password the error is caught and its message is stored in the<strong> error<\/strong> state to be displayed on the screen.<\/p>\n\n\n\n<p><strong>4.2.4. Building the UI Layout<\/strong><\/p>\n\n\n\n<p>Next up, let\u2019s construct the user interface for the registration screen.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>return (\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;View style={styles.container}&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Text h3 style={styles.header}&gt;Register&lt;\/Text&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Input\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder=\"Email\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;leftIcon={{ type: 'material', name: 'email' }}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value={email}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onChangeText={setEmail}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Input\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder=\"Password\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;leftIcon={{ type: 'material', name: 'lock' }}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;secureTextEntry\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value={password}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onChangeText={setPassword}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{error &amp;&amp; &lt;Text style={styles.error}&gt;{error}&lt;\/Text&gt;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Button title=\"Register\" onPress={handleRegister} \/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/View&gt;\n\n&nbsp;&nbsp;);\n\n};<\/code><\/pre>\n\n\n\n<p>The return statement renders a View container that uses the defined styles for layout. Inside the container, a header labeled &#8220;Register&#8221; is displayed using the<strong> Text<\/strong> component, giving users a clear indication of the screen\u2019s purpose.&nbsp;<\/p>\n\n\n\n<p>Two <strong>Input<\/strong> components are used to capture the user&#8217;s email and password, with each field featuring an appropriate icon. The password input has the <strong>secureTextEntry<\/strong> prop enabled so that the characters are hidden for security.&nbsp;<\/p>\n\n\n\n<p>If there is any error during registration, an error message is conditionally rendered on the screen. Finally, a &#8220;Register&#8221; button is provided to trigger the<strong> handleRegister<\/strong> function when pressed.<\/p>\n\n\n\n<p><strong>4.2.5. Styling<\/strong><\/p>\n\n\n\n<p>Once we set up the UI layout, we will start defining the styles using React Native&#8217;s <strong>StyleSheet<\/strong>.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const styles = StyleSheet.create({\n\n&nbsp;&nbsp;container: { flex: 1, justifyContent: 'center', padding: 20 },\n\n&nbsp;&nbsp;header: { marginBottom: 20, textAlign: 'center' },\n\n&nbsp;&nbsp;error: { color: 'red', textAlign: 'center', marginBottom: 10 }\n\n});<\/code><\/pre>\n\n\n\n<p>The <strong>container<\/strong> style makes sure the view takes up the full available space, centers its children vertically, and provides adequate padding.&nbsp;<\/p>\n\n\n\n<p>The <strong>header<\/strong> style centers the header text and adds some margin below it for clear separation from other elements.&nbsp;<\/p>\n\n\n\n<p>The <strong>error<\/strong> style is applied to any error messages, setting the text color to red and centering it, along with a margin to ensure it doesn&#8217;t clutter the layout.<\/p>\n\n\n\n<p><strong>4.2.6. Exporting the Component<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export default RegisterScreen;<\/code><\/pre>\n\n\n\n<p>As we did in 4.2.6, we\u2019ll finally export the RegisterScreen component, making it accessible for use in other parts of the application, such as integrating it into your app&#8217;s navigation stack.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Setting Up Firebase for User Authentication<\/strong><\/h3>\n\n\n\n<p>Create a configuration file named firebase.js:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>5.1. Importing Firebase Modules<\/strong><\/h4>\n\n\n\n<p>In this first step, we import the core Firebase module using <strong>firebase\/app<\/strong> which provides the main Firebase functionality. Then, we import <strong>firebase\/auth<\/strong> to include Firebase&#8217;s authentication features, enabling our app to perform tasks like signing in and signing up users. This is how we\u2019ll do it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import firebase from 'firebase\/app';\n\nimport 'firebase\/auth';<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>5.2. Creating the Firebase Configuration Object<\/strong><\/h4>\n\n\n\n<p>Next, we\u2019ll define a configuration object named<strong> firebaseConfig<\/strong> that holds the details required to connect our app to the correct Firebase project.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Your Firebase configuration object (replace with your actual configuration)\n\nconst firebaseConfig = {\n\n&nbsp;&nbsp;apiKey: 'YOUR_API_KEY',\n\n&nbsp;&nbsp;authDomain: 'your-app.firebaseapp.com',\n\n&nbsp;&nbsp;projectId: 'your-app-id',\n\n&nbsp;&nbsp;storageBucket: 'your-app.appspot.com',\n\n&nbsp;&nbsp;messagingSenderId: 'YOUR_SENDER_ID',\n\n&nbsp;&nbsp;appId: 'YOUR_APP_ID',\n\n};<\/code><\/pre>\n\n\n\n<p>This object contains keys like <strong>apiKey, authDomain<\/strong>, and<strong> appId<\/strong>, among others. These values should be replaced with the actual configuration details from your Firebase console.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>5.3. Initializing Firebase<\/strong><\/h4>\n\n\n\n<p>In this segment, let\u2019s check whether Firebase has already been initialized using <strong>if (!firebase.apps.length).<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Initialize Firebase if not already initialized\n\nif (!firebase.apps.length) {\n\n&nbsp;&nbsp;firebase.initializeApp(firebaseConfig);\n\n}<\/code><\/pre>\n\n\n\n<p>If no Firebase app exists, it calls <strong>firebase.initializeApp(firebaseConfig)<\/strong> to initialize Firebase with our configuration object. This prevents multiple initializations if the module is imported in different parts of the application.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>5.4. Exporting Firebase Services<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>export const auth = firebase.auth();\n\nexport default firebase;<\/code><\/pre>\n\n\n\n<p>Finally, we\u2019ll export the Firebase authentication service as <strong>auth<\/strong> so that it can be easily imported and used in other files for authentication-related tasks. Additionally, we export the default Firebase instance, allowing access to other Firebase services if needed elsewhere in your project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 6: Building the Chat Screen with react-native-gifted-chat<\/strong><\/h3>\n\n\n\n<p>Create a file named <strong>ChatScreen.js:<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>6.1. Importing Modules<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState, useCallback, useEffect } from 'react';\nimport { GiftedChat } from 'react-native-gifted-chat';\nimport { View, StyleSheet } from 'react-native';\n<\/code><\/pre>\n\n\n\n<p>During import, we bring in React along with hooks like <strong>useState, useCallback,<\/strong> and <strong>useEffect<\/strong> to manage state and lifecycle events within our component.&nbsp;<\/p>\n\n\n\n<p>The <strong>Chat component in React Native<\/strong> is implemented using the <code>GiftedChat<\/code> component, which is imported from the <code>react-native-gifted-chat<\/code> library to handle the chat UI, and basic layout components such as <code>View<\/code> and <code>StyleSheet<\/code> are brought in from React Native.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>6.2. Defining the ChatScreen Component and State Initialization<\/strong><\/h4>\n\n\n\n<p>Next, it&#8217;s time to define the <strong>ChatScreen<\/strong> functional component.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const ChatScreen = () =&gt; {\n\n&nbsp;&nbsp;const &#91;messages, setMessages] = useState(&#91;]);<\/code><\/pre>\n\n\n\n<p>Inside the component, we use the <strong>useState<\/strong> hook to initialize a state variable called<strong> messages <\/strong>with an empty array. This state will store all the chat messages and be updated as new messages are sent or loaded.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>6.3. Loading Initial Messages with useEffect<\/strong><\/h4>\n\n\n\n<p>This segment uses the <strong>useEffect<\/strong> hook to load an initial message when the component mounts.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Populate with an initial message (in production, load history from a backend)\n\n&nbsp;&nbsp;useEffect(() =&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;setMessages(&#91;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_id: 1,\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text: 'Hello developer!',\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createdAt: new Date(),\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user: {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_id: 2,\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: 'MirrorFly Bot',\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;avatar: 'https:\/\/placeimg.com\/140\/140\/any',\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},\n\n&nbsp;&nbsp;&nbsp;&nbsp;]);\n\n&nbsp;&nbsp;}, &#91;]);<\/code><\/pre>\n\n\n\n<p>In the example here, a welcome message from a &#8220;MirrorFly Bot&#8221; is set up, but in a real-world app, you would load the chat history from a backend service.&nbsp;<\/p>\n\n\n\n<p>The empty dependency array (<strong>[]<\/strong>) ensures that this effect runs only once when the component is first rendered.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>6.4. Handling New Messages with onSend<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Append new messages to the chat  \nconst onSend = useCallback((newMessages = &#91;]) =&gt; {    \nsetMessages((previousMessages) =&gt;      \nGiftedChat.append(previousMessages, newMessages)    \n);   \n \/\/ In a full app, send the message to the backend \n(MirrorFly) here. \n }, &#91;]);<\/code><\/pre>\n\n\n\n<p>The <strong>onSend<\/strong> function is created using <strong>useCallback<\/strong> to efficiently handle new messages. When a user sends a message, this function appends it to the existing list of messages using the <strong>GiftedChat.append <\/strong>helper function.&nbsp;<\/p>\n\n\n\n<p>Carrying out this step ensures that the newest messages appear at the top. The comment notes that in a complete app, you would also send the new message to your backend (such as MirrorFly) for persistence and real-time updates.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>6.5. Rendering the Chat Interface<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>return (\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;View style={styles.container}&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;GiftedChat\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;messages={messages}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onSend={onSend}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user={{ _id: 1 }} \/\/ The current user's ID\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/View&gt;\n\n&nbsp;&nbsp;);\n\n};<\/code><\/pre>\n\n\n\n<p>Next, in the return statement, the chat interface is rendered inside a<strong> View<\/strong> component. The <strong>GiftedChat<\/strong> component takes in the current list of messages, the <strong>onSend<\/strong> function to handle new messages, and a user object with a unique ID representing the current user.&nbsp;<\/p>\n\n\n\n<p>This setup renders a fully functional chat UI where users can see messages and send new ones.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 7: Integrating MirrorFly Chat SDK for Android<\/strong><\/h3>\n\n\n\n<p>This section explains how to integrate MirrorFly into your Android project so that your React Native app (specifically the Android module) can handle real\u2011time messaging.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.1. Configure the Android Project<\/strong><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Step 1: Open or Create Your Android Project<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use Android Studio to create a new project or open your existing React Native project\u2019s <strong>android\/<\/strong> folder.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Step 2: Configure Gradle Repositories<\/strong><\/h4>\n\n\n\n<p>For Gradle 6.8 or higher, add the following to your <strong>settings. gradle:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dependencyResolutionManagement {\n\n&nbsp;&nbsp;&nbsp;&nbsp;repositories {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mavenCentral()\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;google()\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jcenter()\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maven {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url \"https:\/\/github.com\/orgs\/MirrorFly\/repositories\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p>This gifted chat react native code configures dependency resolution in your Gradle build by specifying a set of repositories where Gradle should search for libraries and dependencies. It lists popular repositories like Maven Central, Google, and JCenter, ensuring that standard dependencies are easily found.&nbsp;<\/p>\n\n\n\n<p>Additionally, it includes a custom Maven repository at &#8220;https:\/\/github.com\/orgs\/MirrorFly\/repositories&#8221; which likely hosts specific artifacts or libraries provided by MirrorFly. This setup ensures that your project can fetch both common and custom dependencies needed during the build process.For Gradle 6.7 or lower, add the corresponding configuration in your root<strong> build.gradle.<\/strong><\/p>\n\n\n\n<p><strong>Step 3: Add MirrorFly Dependency<\/strong><\/p>\n\n\n\n<p>In your <strong>app\/build.gradle<\/strong> file, add:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dependencies {   \nimplementation \n'com.mirrorfly.sdk:mirrorflysdk:7.13.13\n'}<\/code><\/pre>\n\n\n\n<p><strong>Step 4: Resolve Library Conflicts<\/strong><\/p>\n\n\n\n<p>In your <strong>gradle.properties<\/strong> file, add:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>android.enableJetifier=true<\/strong><\/code><\/pre>\n\n\n\n<p><strong>Step 5: Update AndroidManifest.xml<\/strong><\/p>\n\n\n\n<p>Ensure you have the necessary permissions by adding the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;uses-permission \n\nandroid:name=\"android.permission.INTERNET\" \/&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.2. Initialize the MirrorFly Chat SDK<\/strong><\/h4>\n\n\n\n<p>Create or update your Application class (e.g.,<strong> MyApplication.java)<\/strong> to initialize the MirrorFly SDK.<\/p>\n\n\n\n<p><strong>MyApplication.java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ MyApplication.java\n\npackage com.example.giftedchatapp;\n\nimport android.app.Application;\n\nimport android.util.Log;\n\nimport com.mirrorfly.sdk.ChatManager;\n\npublic class MyApplication extends Application {\n\n&nbsp;&nbsp;&nbsp;&nbsp;@Override\n\n&nbsp;&nbsp;&nbsp;&nbsp;public void onCreate() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super.onCreate();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Initialize MirrorFly with your License Key\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChatManager.initializeSDK(\"YOUR_LICENSE_KEY\", (isSuccess, throwable, data) -&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isSuccess){\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.d(\"TAG\", \"initializeSDK success\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.d(\"TAG\", \"initializeSDK failed with reason \" + data.get(\"message\"));\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n}<\/code><\/pre>\n\n\n\n<p>This code defines a custom <strong>Application<\/strong> class for your Android app. When the app starts, the onCreate method is called, and it initializes the MirrorFly <strong>ChatManager<\/strong> SDK using your license key.&nbsp;<\/p>\n\n\n\n<p>The initialization process uses a callback to determine whether it was successful. If it is, a success message is logged; if not, an error message along with the failure reason is logged. This ensures that the MirrorFly SDK is ready to handle chat functionalities as soon as your app launches.<strong>Application Class Registration:<br><\/strong>Update your <strong>AndroidManifest.xml<\/strong> to register your Application class:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;application\n\n&nbsp;&nbsp;&nbsp;&nbsp;android:name=\".MyApplication\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;android:icon=\"@mipmap\/ic_launcher\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;android:label=\"@string\/app_name\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;android:theme=\"@style\/AppTheme\"&gt;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- Other activities --&gt;\n\n&lt;\/application&gt;<\/code><\/pre>\n\n\n\n<p>This XML snippet is part of your AndroidManifest.xml file and defines the overall application settings. The <strong>android:name=&#8221;.MyApplication&#8221;<\/strong> attribute tells the system to use your custom <strong>MyApplication<\/strong> class as the application instance, which allows you to perform global initialization tasks, like initializing the MirrorFly SDK, when the app starts.&nbsp;<\/p>\n\n\n\n<p>Additionally, the snippet specifies the app&#8217;s icon, label, and theme, ensuring that these resources are applied throughout your app, while also leaving room for other activities to be defined within the application block.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.3. Register a User with MirrorFly<\/strong><\/h4>\n\n\n\n<p>After initialization, register your user. This should be done once per session.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ In an appropriate activity or service after login:\n\nFlyCore.registerUser(\"USER_IDENTIFIER\", (isSuccess, throwable, data) -&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;if (isSuccess) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean isNewUser = (Boolean) data.get(\"is_new_user\"); \/\/ Check if user is new\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String userJid = (String) data.get(\"userJid\"); \/\/ Example: 12345678@xmpp-preprod-sandbox.mirrorfly.com\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JSONObject responseObject = (JSONObject) data.get(\"data\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String username = responseObject.getString(\"username\");\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Continue with app flow after successful registration.\n\n&nbsp;&nbsp;&nbsp;&nbsp;} else {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Handle registration error (log throwable for details)\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n});<\/code><\/pre>\n\n\n\n<p>The <strong>registerUser<\/strong> method is called with a unique user identifier (which should be replaced with an actual ID) and a callback function that processes the result.&nbsp;<\/p>\n\n\n\n<p>In the callback, if registration is successful (indicated by isSuccess being true), the code retrieves several pieces of information from the data object: it checks if the user is new via the<strong> is_new_user flag<\/strong>, extracts the user\u2019s JID (a unique identifier used in the chat system), and retrieves a JSON object containing additional details such as the username.&nbsp;<\/p>\n\n\n\n<p>If the registration fails, the error details can be handled using the provided throwable object. This approach allows your app to seamlessly integrate user registration into the flow after login, ensuring that all necessary user details are available for further use in the application.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.4. Establish a Connection and Listen for Events<\/strong><\/h4>\n\n\n\n<p>MirrorFly automatically attempts to connect to the Chat Server after registration. To monitor connection status, set up a connection listener.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ChatManager.setConnectionListener(new ChatConnectionListener() {\n    @Override\n    public void onConnected() {\n        \/\/ Connection established: proceed to load user profile or chat UI.\n    }\n\n    @Override\n    public void onDisconnected() {\n        \/\/ Handle disconnection events.\n    }\n\n    @Override\n    public void onConnectionFailed(@NonNull FlyException e) {\n        \/\/ Log or display connection failure details.\n    }\n\n    @Override\n    public void onReconnecting() {\n        \/\/ Inform user that the app is attempting to reconnect.\n    }\n});\n<\/code><\/pre>\n\n\n\n<p>This code sets up a connection listener for your chat system using the <strong>ChatManager.<\/strong> It attaches a new<strong> ChatConnectionListener<\/strong> that overrides four methods to handle various connection events.&nbsp;<\/p>\n\n\n\n<p>When the connection is successfully established, the <strong>onConnected<\/strong> method is triggered, allowing you to load the user&#8217;s profile or chat interface. If the connection is lost, onDisconnected is called to manage disconnection events.&nbsp;<\/p>\n\n\n\n<p>If there are any issues while establishing a connection, <strong>onConnectionFailed<\/strong> is invoked, providing details of the failure for logging or display purposes.&nbsp;<\/p>\n\n\n\n<p>Additionally, onReconnecting informs you when the app is attempting to re-establish the connection. Overall, this listener ensures that your app can effectively respond to changes in the chat connection status.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.5. Generate User JID<\/strong><\/h4>\n\n\n\n<p>To generate a Jabber ID (JID) for any user, call:<\/p>\n\n\n\n<p><strong>String userJid = FlyUtils.getJid(&#8220;USER_NAME&#8221;);<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.6. Sending a One-to-One Message<\/strong><\/h4>\n\n\n\n<p>To send a message to another user, create a<strong> TextMessage<\/strong> object and call the send function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TextMessage textMessage = new TextMessage();\n\ntextMessage.setToId(\"RECIPIENT_JID\");&nbsp; \/\/ The recipient\u2019s JID\n\ntextMessage.setMessageText(\"Hello, how are you?\");&nbsp; \/\/ Your message text\n\nFlyMessenger.sendTextMessage(textMessage, (isSuccess, error, chatMessage) -&gt; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;if (isSuccess) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Message sent successfully; update UI or log response.\n\n&nbsp;&nbsp;&nbsp;&nbsp;} else {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Handle error in message sending.\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n});<\/code><\/pre>\n\n\n\n<p>This code snippet demonstrates how to create and send a text message using the <strong>FlyMessenger <\/strong>service. First, a new <strong>TextMessage<\/strong> object is created and configured by setting the recipient&#8217;s JID and the message content (&#8220;Hello, how are you?&#8221;).&nbsp;<\/p>\n\n\n\n<p>Then, the <strong>FlyMessenger.sendTextMessage <\/strong>method is called with the text message and a callback function.&nbsp;<\/p>\n\n\n\n<p>The callback checks if the message was sent successfully, allowing you to update the user interface or log the response accordingly, or handle any errors that may have occurred during the sending process.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>7.7. Receiving Messages<\/strong><\/h4>\n\n\n\n<p>Set up a listener to capture incoming messages.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ChatEventsManager.setupMessageEventListener(new MessageEventsListener() {\n\n&nbsp;&nbsp;&nbsp;&nbsp;@Override\n\n&nbsp;&nbsp;&nbsp;&nbsp;public void onMessageReceived(@NonNull ChatMessage message) {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Handle the incoming message (update chat UI accordingly).\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n});<\/code><\/pre>\n\n\n\n<p>This code registers a message event listener using the<strong> ChatEventsManager.<\/strong> By passing a new <strong>MessageEventsListener<\/strong> with an overridden<strong> onMessageReceived<\/strong> method, the application is set up to automatically handle incoming chat messages. Whenever a new message arrives, the <strong>onMessageReceived<\/strong> method is triggered, allowing you to update the chat UI or perform other actions in real time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 8: Integrating with React Native<\/strong><\/h3>\n\n\n\n<p>While the native Android integration (steps in Section 7) handles real\u2011time messaging with MirrorFly, you can bridge these native functionalities to your React Native code using Native Modules or libraries like <strong>react-native-bridge.<\/strong> This allows your JavaScript code (which drives Gifted Chat) to call native functions like sending and receiving messages.<\/p>\n\n\n\n<p>For example, you might expose a native module that provides methods such as <strong>sendMessage<\/strong> or <strong>initializeMirrorFly<\/strong> that can be invoked from your React Native components. Detailed bridging steps are available in the React Native documentation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Final_Thoughts_and_Next_Steps\"><\/span><strong>Final Thoughts and Next Steps<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Using React Native Gifted Chat with the MirrorFly Chat SDK gives you a complete and flexible solution for building a chat app that not only looks great but also performs exceptionally well.&nbsp;<\/p>\n\n\n\n<p>Gifted Chat handles the front-end by providing ready-made, customizable elements like message bubbles, avatars, and input fields that work seamlessly on iOS, Android, and the web.&nbsp;<\/p>\n\n\n\n<p>On the back end, <a href=\"https:\/\/www.mirrorfly.com\/chat-api-solution.php\">MirrorFly Chat SDK<\/a> adds powerful messaging features: supporting instant messaging, voice, and video calls while <a href=\"https:\/\/www.mirrorfly.com\/chat-security.php\">keeping your app secure<\/a> and running smoothly.&nbsp;<\/p>\n\n\n\n<p>What really makes <strong>MirrorFly<\/strong> stand out is its total customizability. You can add, modify or remove any feature and workflow to your exact needs, and you even own your data and source code.&nbsp;<\/p>\n\n\n\n<p>It offers options for <a href=\"https:\/\/www.mirrorfly.com\/instant-messaging-app-development.php\">hiring a dedicated team<\/a>, <a href=\"https:\/\/www.mirrorfly.com\/self-hosted-chat-solution.php\">flexible hosting<\/a>, and a white-label solution that lets you fully brand your chat experience.&nbsp;<\/p>\n\n\n\n<p>Want to know more about this solution? <a href=\"https:\/\/www.mirrorfly.com\/contact-sales.php\">MirrorFly Team<\/a> today!&nbsp;<\/p>\n\n\n\n<p><strong>Related Article: <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.mirrorfly.com\/blog\/best-voice-chat-app\/\">Best Voice Chat apps in 2025<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mirrorfly.com\/blog\/build-video-conferencing-app-like-zoom\/\">Build a Video Conferencing App like Zoom<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-like-discord\/\">Build a Gaming Chat App Like Discord<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"cta-wrapper-two\">\n<h5 class=\"cta-heading-two\">Ready To Build Your Own <span class=\"highlight\">React Native Chat APP<\/span><\/h5>\n<p class=\"cta-content-two\">Deliver secure chat experience with 1000+ interactive real-time chat features,video<\/p>\n<a href=\"https:\/\/www.mirrorfly.com\/request-demo.php\" class=\"self-host-cta-btn\">Request Demo<\/a>\n<ul class=\"cta-wrapper-list-two\">\n<li><img decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=\" data-src=\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/themes\/mirrorfly\/assets\/images\/tick-icon.svg\">\n100% Customizable\n<\/li>\n<li><img decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=\" data-src=\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/themes\/mirrorfly\/assets\/images\/tick-icon.svg\">\nHosting On Own Server<\/li>\n<li><img decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=\" data-src=\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/themes\/mirrorfly\/assets\/images\/tick-icon.svg\">\nFull Source-code Ownership<\/li>\n<\/ul>\n<img decoding=\"async\" src=\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/themes\/mirrorfly\/assets\/images\/saas-cta-bg.webp\" class=\"cta-image-thumbnail-two\">\n<\/div>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"http:\/\/schema.org\",\n  \"@type\": \"CreativeWorkSeries\",\n  \"name\": \"How to build react native gifted chat\",\n  \"url\": \"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\",\n  \"aggregateRating\": {\n    \"@type\": \"AggregateRating\",\n    \"ratingValue\": \"4.8\",\n    \"bestRating\": 5,\n    \"ratingCount\": 237\n  }\n}\n<\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building your own custom chat app with a React Native Gifted Chat solution ensures that you deploy your platform quickly without spending months writing codes.&nbsp; With a pre-built CPaaS solution like MirrorFly, you don&#8217;t even need tech skills to build a messaging app in React Native Gifted Chat.&nbsp; Follow these 8 steps to build your [&hellip;]<\/p>\n","protected":false},"author":85,"featured_media":42353,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_stopmodifiedupdate":false,"_modified_date":"","footnotes":""},"categories":[1272],"tags":[],"class_list":["post-37685","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-talks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Build a Chat App with React Native Gifted Chat (2026 Tutorial)<\/title>\n<meta name=\"description\" content=\"Learn how to build a chat app with react-native-gifted-chat. Follow step-by-step guide covering setup, user authentication &amp; SDK integration\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build a React Native Gifted Chat App:The Complete 2025 Guide\" \/>\n<meta property=\"og:description\" content=\"The 2025 guide to building a React Native chat app with Gifted Chat\u2014learn to add file sharing, previews, and more for a rich messaging experience!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\" \/>\n<meta property=\"og:site_name\" content=\"MirrorFly Blog - Chat API And Messaging SDK for your Mobile and Web Apps\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MirrorFlyofficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-11T10:34:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-09T11:08:26+00:00\" \/>\n<meta name=\"author\" content=\"Atchaya Jayabal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"The Ultimate 2025 Guide to Build a React Native Gifted Chat App\" \/>\n<meta name=\"twitter:description\" content=\"Master React Native chat in 2025! Build a chat app with Gifted Chat, covering UI setup, file attachments, and smooth messaging in this guide.\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Atchaya Jayabal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"22 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\"},\"author\":{\"name\":\"Atchaya Jayabal\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/person\/27e1ae59b77c7775bd63034148eb3294\"},\"headline\":\"Build a Chat App With React Native Gifted Chat (2026 Guide)\",\"datePublished\":\"2025-03-11T10:34:52+00:00\",\"dateModified\":\"2026-04-09T11:08:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\"},\"wordCount\":3998,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#organization\"},\"articleSection\":[\"Tech Talks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\",\"url\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\",\"name\":\"Build a Chat App with React Native Gifted Chat (2026 Tutorial)\",\"isPartOf\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#website\"},\"datePublished\":\"2025-03-11T10:34:52+00:00\",\"dateModified\":\"2026-04-09T11:08:26+00:00\",\"description\":\"Learn how to build a chat app with react-native-gifted-chat. Follow step-by-step guide covering setup, user authentication & SDK integration\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/www.mirrorfly.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tech Talks\",\"item\":\"https:\/\/www.mirrorfly.com\/blog\/category\/tech-talks\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Build a Chat App With React Native Gifted Chat (2026 Guide)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#website\",\"url\":\"https:\/\/www.mirrorfly.com\/blog\/\",\"name\":\"MirrorFly Blog - Chat API And Messaging SDK for your Mobile and Web Apps\",\"description\":\"World&#039;s Most Scalable Chat APIs &amp; SDKs for Small, Medium &amp; Enterprises\",\"publisher\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.mirrorfly.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#organization\",\"name\":\"MirrorFly\",\"url\":\"https:\/\/www.mirrorfly.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2020\/07\/mirrorfly-blue.png\",\"contentUrl\":\"https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2020\/07\/mirrorfly-blue.png\",\"width\":520,\"height\":100,\"caption\":\"MirrorFly\"},\"image\":{\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/MirrorFlyofficial\/\",\"https:\/\/www.instagram.com\/mirrorflyofficial\/\",\"https:\/\/www.linkedin.com\/showcase\/mirrorfly-official\/\",\"https:\/\/x.com\/MirrorFlyTeam\/\",\"https:\/\/github.com\/mirrorfly\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/person\/27e1ae59b77c7775bd63034148eb3294\",\"name\":\"Atchaya Jayabal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c7684e399858444026b2603501ecba15?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c7684e399858444026b2603501ecba15?s=96&d=mm&r=g\",\"caption\":\"Atchaya Jayabal\"},\"description\":\"Atchaya Jayabal is a passionate content writer specializing in SaaS, B2B and Technical Writing. She is best known for her adept expertise in curating tech content that resonates with readers.\",\"url\":\"https:\/\/www.mirrorfly.com\/blog\/author\/atchaya-jayabal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Build a Chat App with React Native Gifted Chat (2026 Tutorial)","description":"Learn how to build a chat app with react-native-gifted-chat. Follow step-by-step guide covering setup, user authentication & SDK integration","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/","og_locale":"en_US","og_type":"article","og_title":"Build a React Native Gifted Chat App:The Complete 2025 Guide","og_description":"The 2025 guide to building a React Native chat app with Gifted Chat\u2014learn to add file sharing, previews, and more for a rich messaging experience!","og_url":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/","og_site_name":"MirrorFly Blog - Chat API And Messaging SDK for your Mobile and Web Apps","article_publisher":"https:\/\/www.facebook.com\/MirrorFlyofficial\/","article_published_time":"2025-03-11T10:34:52+00:00","article_modified_time":"2026-04-09T11:08:26+00:00","author":"Atchaya Jayabal","twitter_card":"summary_large_image","twitter_title":"The Ultimate 2025 Guide to Build a React Native Gifted Chat App","twitter_description":"Master React Native chat in 2025! Build a chat app with Gifted Chat, covering UI setup, file attachments, and smooth messaging in this guide.","twitter_misc":{"Written by":"Atchaya Jayabal","Est. reading time":"22 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#article","isPartOf":{"@id":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/"},"author":{"name":"Atchaya Jayabal","@id":"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/person\/27e1ae59b77c7775bd63034148eb3294"},"headline":"Build a Chat App With React Native Gifted Chat (2026 Guide)","datePublished":"2025-03-11T10:34:52+00:00","dateModified":"2026-04-09T11:08:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/"},"wordCount":3998,"commentCount":0,"publisher":{"@id":"https:\/\/www.mirrorfly.com\/blog\/#organization"},"articleSection":["Tech Talks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/","url":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/","name":"Build a Chat App with React Native Gifted Chat (2026 Tutorial)","isPartOf":{"@id":"https:\/\/www.mirrorfly.com\/blog\/#website"},"datePublished":"2025-03-11T10:34:52+00:00","dateModified":"2026-04-09T11:08:26+00:00","description":"Learn how to build a chat app with react-native-gifted-chat. Follow step-by-step guide covering setup, user authentication & SDK integration","breadcrumb":{"@id":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mirrorfly.com\/blog\/build-a-chat-app-with-react-native-gifted-chat\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mirrorfly.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tech Talks","item":"https:\/\/www.mirrorfly.com\/blog\/category\/tech-talks\/"},{"@type":"ListItem","position":3,"name":"Build a Chat App With React Native Gifted Chat (2026 Guide)"}]},{"@type":"WebSite","@id":"https:\/\/www.mirrorfly.com\/blog\/#website","url":"https:\/\/www.mirrorfly.com\/blog\/","name":"MirrorFly Blog - Chat API And Messaging SDK for your Mobile and Web Apps","description":"World&#039;s Most Scalable Chat APIs &amp; SDKs for Small, Medium &amp; Enterprises","publisher":{"@id":"https:\/\/www.mirrorfly.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mirrorfly.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mirrorfly.com\/blog\/#organization","name":"MirrorFly","url":"https:\/\/www.mirrorfly.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2020\/07\/mirrorfly-blue.png","contentUrl":"https:\/\/www.mirrorfly.com\/blog\/wp-content\/uploads\/2020\/07\/mirrorfly-blue.png","width":520,"height":100,"caption":"MirrorFly"},"image":{"@id":"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/MirrorFlyofficial\/","https:\/\/www.instagram.com\/mirrorflyofficial\/","https:\/\/www.linkedin.com\/showcase\/mirrorfly-official\/","https:\/\/x.com\/MirrorFlyTeam\/","https:\/\/github.com\/mirrorfly"]},{"@type":"Person","@id":"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/person\/27e1ae59b77c7775bd63034148eb3294","name":"Atchaya Jayabal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mirrorfly.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c7684e399858444026b2603501ecba15?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c7684e399858444026b2603501ecba15?s=96&d=mm&r=g","caption":"Atchaya Jayabal"},"description":"Atchaya Jayabal is a passionate content writer specializing in SaaS, B2B and Technical Writing. She is best known for her adept expertise in curating tech content that resonates with readers.","url":"https:\/\/www.mirrorfly.com\/blog\/author\/atchaya-jayabal\/"}]}},"_links":{"self":[{"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/posts\/37685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/comments?post=37685"}],"version-history":[{"count":52,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/posts\/37685\/revisions"}],"predecessor-version":[{"id":44353,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/posts\/37685\/revisions\/44353"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/media\/42353"}],"wp:attachment":[{"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/media?parent=37685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/categories?post=37685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mirrorfly.com\/blog\/wp-json\/wp\/v2\/tags?post=37685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}