Git Product home page Git Product logo

flyerhq / react-native-firebase-chat-core Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 17.0 2.65 MB

Actively maintained, community-driven Firebase BaaS for chat applications with an optional chat UI.

Home Page: https://flyer.chat

License: Apache License 2.0

JavaScript 5.23% Starlark 1.21% Ruby 1.43% Swift 3.50% Objective-C 0.40% TypeScript 77.30% Kotlin 10.92%
android chat firebase ios react-native typescript

react-native-firebase-chat-core's People

Contributors

demchenkoalex avatar voidozzer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-firebase-chat-core's Issues

Build failed: compileDebugKotlin

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

I'm getting this error when I try to build the example. Any clues about how to fix it?

Pagination?

Hello, I'm interested in migrating to this from Gifted-Chat. How do you handle long chat histories? Do you just load every document whenever the chat is opened or do you implement some type of pagination? If so, does it work with live updates?

Thanks!

[Expo] Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app().

General

What bug do you experience? ๐Ÿž

While using with Expo 42.0.0, calling fetchUser returns:

Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app().

How can it be reproduced? ๐Ÿค”

A few steps to define where does the bug occur.
Step 1. Create new app with Expo 42.
Step 2. Create project in Firebase and add it to the application.
Step 3. Sign in (e.g. Anonymously), get user and try call fetchUser(firebaseUser.uid)

What behavior is expected? ๐Ÿ’ก

The method fetchUser should be called correctly.


Extras

Code snippets ๐Ÿ“

Minimum example:

import React, { useEffect } from 'react'
import firebase from 'firebase'
import { createUserInFirestore, fetchUser } from '@flyerhq/react-native-firebase-chat-core'
import { firebaseConfig } from './config'

const MyComponent = () => {
   useEffect(() => {
      firebase.initializeApp(firebaseConfig)

      const firebaseUser = firebase.auth().currentUser

     if (!firebaseUser) {
       firebase.auth().signInAnonymously()
         .then(newUser =>newUser &&  fetchUser(newUser.uid) // <-- here throws below error
     }
   }, [])


   return (
    <View><Text>Sample</Text></View>
   ) 
}

Environment info

Please specify the react, react-native, react-native-firebase-chat-core versions.

react: 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz
react-native-firebase-chat-core: 1.0.1

npx react-native info output ๐Ÿ‘‡

System:
    OS: macOS 11.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 667.56 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.4 - /usr/local/bin/pod
  SDKs:
    iOS SDK: Not Found
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3
      System Images: android-28 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.3 AI-182.5107.16.33.5264788
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_201 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Platform

Device: sm-g781b

OS version Android 11


Spread operator should be used instead

Issue

The current implementation forces us to implement all the properties in User unless we set ignoreUndefinedProperties in the Firestore SDK.

Cause

The User datatype contains a bunch of optional properties and it will become undefined if we reference it as our current implementation.

export const createUserInFirestore = async (user: User) => {

Suggested solution

We should use spread operator instead:

export const createUserInFirestore = async (user: User) => {
  const { id, ...rest } = user;
  await firestore().collection(USERS_COLLECTION_NAME).doc(id).set({
    ...rest,
    createdAt: firestore.FieldValue.serverTimestamp(),
    updatedAt: firestore.FieldValue.serverTimestamp(),
  })
}

It's also less code.

Preview of an image before uploading it and sending it

Hello ๐Ÿ‘‹
Could someone give me an idea of how to implement a full screen preview of an image before uploading it and sending it as a message?

similar to when you tap on a bubble with an image you see a full screen preview with a close button(X), I would like to know if something like that can be implemented but just before sending the image after selecting it from the ImagePicker

Can not create Room using `Id`

Hello!

I am facing issue with creating room.

I used sign in with phone number.

const confirmation = await auth().signInWithPhoneNumber(phoneNumber);

And getting user

const {firebaseUser} = useFirebaseUser();

and creating room

let U = { "id": firebaseUser?.uid };

createRoom(U).then((res:any)=>{console.log("res",res); }).catch((err: any) => { console.log(err); })

but I received error

[TypeError: undefined is not an object (evaluating 'data.createdAt')]

Can anyone help to fix this?

React Native createUserInFirestore => Error: Unsupported field value: undefined

While running createUserInFirestore with minimum setup given from https://docs.flyer.chat/react-native/firebase/firebase-usage
{
firstName: 'John',
id: credential.user.uid, // UID from Firebase Authentication
imageUrl: 'https://i.pravatar.cc/300',
lastName: 'Doe',
}

getting Error: Error: Unsupported field value: undefined

while setting all data:
{
firstName: userData?.fullname,
id: UID,
imageUrl: userData?.imagePath,
lastName: ' ',
metadata: ' ',
lastSeen: firebaseCurrentUser?.metadata?.lastSignInTime,
role : userRole
}

the await will never ends and i didn't get response.

Unable to install example

Screen Shot 2023-03-04 at 6 13 44 PM

There are no changes in Info.plist file, I am using M1 machine.

EDIT: solved now - I needed to re-add Google Plist file, as it was not copied properly on the first time. You can close this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.