Slide 1

Slide 1 text

Firebase Chat Adding chat feature to a React Native App with Firebase

Slide 2

Slide 2 text

Gurzu Confidential • Added chat feature to one of the apps we developed at Gurzu. • With time constraints, opted for Firebase integration with existing authentication feature. • Leveraged Firebase real-time features, Cloud Firestore 2 Introduction

Slide 3

Slide 3 text

Gurzu Confidential • Configured Firebase project. • Enabled Cloud Firestore and set up database security rules 3 Setting up Firestore

Slide 4

Slide 4 text

Gurzu Confidential 4

Slide 5

Slide 5 text

Gurzu Confidential 5 Structuring the Database Model • Firestore: NoSQL document based real-time database • Collections: conversations, messages and users

Slide 6

Slide 6 text

Gurzu Confidential • Users Collection • Stores user data: fullName, avatar • DocumentId: respective user’s userId 6 Structuring the Database Model

Slide 7

Slide 7 text

Gurzu Confidential • Conversations Collection • Stores conversation data: conversationName, conversationType, members, recentMessage • DocumentId: conversationId 7 Structuring the Database Model

Slide 8

Slide 8 text

Gurzu Confidential • Messages Collection • Stores message data: messageText, messageType, sender, images, conversationId 8 Structuring the Database Model

Slide 9

Slide 9 text

Gurzu Confidential • Used the Gifted Chat library for the chat interface 9 Building Chat UI

Slide 10

Slide 10 text

Gurzu Confidential 1 0 Implementing Chat Functionality

Slide 11

Slide 11 text

Gurzu Confidential • Cloud Firestore Documentation: Firestore methods for querying, reading, writing, updating and removing chat data • Queries firestore to get user’s conversations 1 1 Storing and Rendering Chats

Slide 12

Slide 12 text

Gurzu Confidential • Sending a new message • Creates a new document in the “messages” collection • Defines the messageType and updates the referenced conversation details • Deleting message • Removes message document from collection 1 2 Storing and Rendering Chats

Slide 13

Slide 13 text

Gurzu Confidential • Starting new conversation • Creates a new document in the “conversations” collection 1 3 Storing and Rendering Chats

Slide 14

Slide 14 text

Gurzu Confidential • Firebase integration enhanced user engagement. • Real-time capabilities with Firebase facilitated quick setup. • Gifted Chat library saved development time with customizable UI components. • Firebase Cloud Functions and Cloud Messaging enabled efficient push notifications. • Result: Seamless messaging, real-time user connections, and interactions. 1 4 Conclusion

Slide 15

Slide 15 text

Gurzu Confidential ● React-native-firebase docs ● Cloud Firestore Usage ● Gifted Chat Library ● Build a Chat App with Firebase and React Native ● Add A Chat To Your React Native App With Firebase And Firestore References

Slide 16

Slide 16 text

“ Gurzu Confidential Any Queries? 16

Slide 17

Slide 17 text

“ Gurzu Confidential Ichhya Amatya Thank You ! 17