Git Product home page Git Product logo

Comments (5)

DeeAndroid avatar DeeAndroid commented on August 11, 2024

I'm also Facing the same issue is it resolved? @milch-shake

from react-native-firebase-chat-core.

milch-shake avatar milch-shake commented on August 11, 2024

I'm also Facing the same issue is it resolved? @milch-shake

yeah, i am just using another method:

try {
authResponse = await auth().createUserWithEmailAndPassword( [USER E-MAIL], [PASSWORD HASH]);
} catch (e) {
authResponse = await auth().signInWithEmailAndPassword([USER E-MAIL], [PASSWORD HASH]);
}

from react-native-firebase-chat-core.

DeeAndroid avatar DeeAndroid commented on August 11, 2024

I'm also Facing the same issue is it resolved? @milch-shake

yeah, i am just using another method:

try { authResponse = await auth().createUserWithEmailAndPassword( [USER E-MAIL], [PASSWORD HASH]); } catch (e) { authResponse = await auth().signInWithEmailAndPassword([USER E-MAIL], [PASSWORD HASH]); }

so Still the Google sign in is not working right ? @milch-shake

from react-native-firebase-chat-core.

ermohitpy avatar ermohitpy commented on August 11, 2024

I'm also Facing the same issue is it resolved? @milch-shake

yeah, i am just using another method:

try { authResponse = await auth().createUserWithEmailAndPassword( [USER E-MAIL], [PASSWORD HASH]); } catch (e) { authResponse = await auth().signInWithEmailAndPassword([USER E-MAIL], [PASSWORD HASH]); }

the error is generated from createUserInFirestore function not from user registration function

from react-native-firebase-chat-core.

ermohitpy avatar ermohitpy commented on August 11, 2024

I research this error and find that , this error comes when we trying to set a field with a value of undefined in firebase firestore . So , i resolved this error by examine all the data-source which we send through createUserInFirebase function, So , i go to the same function in the nodemodule at location node_modules/@flyerhq/react-native-firebase-chat-core/lib/utils.js and add this code which simply remove the key which value undefined and the function works properly:
`/** Creates {@link User} in Firebase to store name and avatar used on rooms list */
const createUserInFirestore = async (user) => {
const dataToSet = {
createdAt: firestore_1.default.FieldValue.serverTimestamp(),
firstName: user.firstName,
imageUrl: user.imageUrl,
lastName: user.lastName,
// Add other fields here if they have values
updatedAt: firestore_1.default.FieldValue.serverTimestamp(),
};

    // Remove fields with undefined values
    for (const key in dataToSet) {
      if (dataToSet.hasOwnProperty(key) && dataToSet[key] === undefined) {
        delete dataToSet[key];
      }
    }
  
    await (0, firestore_1.default)()
      .collection(exports.USERS_COLLECTION_NAME)
      .doc(user.id)
      .set(dataToSet);
};

exports.createUserInFirestore = createUserInFirestore;
`

from react-native-firebase-chat-core.

Related Issues (13)

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.