npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-gifted-fire-chat

v2.0.0

Published

A fully customizable chat component for React Native

Downloads

11

Readme

React Native Gifted Fire Chat

React Native Gifted chat is an abstraction over React Native Gifted Chat and React Native Firebase. It provides a simpler API to integrate a chat component into a React Native app, using Firebase Realtime Database to store the chat data.

Follow author on Github Follow author on LinkedIn

Motivations and Aims

The idea behind this package was to simplify the process of integrating a chat component in a React Native app. While working on a personal project, I had trouble finding any documentation or resources to do this. So, I decided to create a module myself and share it so that anyone else who might face the same problem as I did, might stumble upon this package.

IMPORTANT NOTES

  • If you are using [email protected], then use version 1.2.4. Else, use version >= 2.0.0

  • This module supports only Android right now. It has not been tested on iOS. Using this module on iOS may result in unexpected behaviour.

  • Module will not work without an internet connection(obviously). So remember to check for internet connection. Check Tips section

Installation

  1. Initialize a react native app using react-native-cli if you dont have one already. Use react-native version 0.60.x

  2. Install Gifted Chat UI yarn add react-native-gifted-chat or npm install --save react-native-gifted-chat

  3. Follow all the instructions here to integrate firebase credentials into your app. Don't build the project yet.

  4. Add the core module to your project. yarn add @react-native-firebase/app or npm install --save @react-native-firebase/app

  5. Add realtime database dependency to your app yarn add @react-native-firebase/database or npm install --save @react-native-firebase/database.

  6. Build your project by running react-native run-android

After completing the installation, you are ready to use this package.

Usage

import GiftedFireChat from 'react-native-gifted-fire-chat';

render() {
    return(
		<GiftedFireChat
			senderPhoneNumber='+11234567890'
			receiverPhoneNumber='+10987654321'
		/>
	)
}
  • Required Props:

    • senderPhoneNumber: (string) The current user's phone number along with the country code. Eg: If you are providing a phone number from India, then it should be given as "+911234567890".
    • receiverPhoneNumber: (string) The phone number of the other user. It should be provided in a similar format as the sender's number.
  • Optional Props

    • userId(String): A custom id passed to denote the sender's identity. Make sure that it is unique for each user. Default is the sender's phone number passed in senderPhoneNumber prop.
    • userAvatar (String): A url for the user image. It can be a local or a network image
    • userName (String): Name of the user to enter into the message object
    • All other react-native-gifted-chat props. View documentation here. Quick replies and system messages are not yet supported.

Tips

  1. Use react-native-gifted-chat props here to customize the UI to suit your app. You can change almost everything to suit your needs.
  2. To insert a header into your view, it is recommended to use Header from react-native-elements. View the documentation.
  3. Use a navigation library such as react-navigation or react-native-router-flux to move from one screen to another. You can also user the header provided by these libraries if you wish so. View react-navigation. View react-native-router-flux.
  4. Use @react-native-community/netinfo to check for internet connectivity. View here.

Future Works

I plan to add support for sending images and videos using Firebase Storage, support for location sharing. If you want to contribute, ping me and I will add you as a collaborator.