Hi Team
I need some help, i am using firebase version 9.19.1 and i have already register my app name on firebase console. eShopMobile. Now i am getting an issue with firebase.js that length is getting an error. Question how do i configure firebase version 9.19.1, when using react-native.
// Import the functions you need from the SDKs you need
import * as firebase from "firebase";
// TODO: Add SDKs for Firebase products that you want to use
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "*******",
authDomain: "eshopmobile-fb508.firebaseapp.com",
projectId: "eshopmobile-fb508",
storageBucket: "eshopmobile-fb508.appspot.com",
messagingSenderId: "734223583165",
appId: "1:734223583165:web:6849ecf86323894686b4d4"
};
// initialize firebase
let app;
if(!firebase.apps.length) {
app = firebase.initializeApp(firebaseConfig);
}
// const auth = firebase.auth()
export {firebase};
Tuhin PaulPosted Apr 16, 2023, 6:51 AM
It looks like the issue you're experiencing might be related to the length of the Firebase app name. The Firebase app name should be less than or equal to 30 characters in length. If your app name exceeds this limit, you might get the error message you mentioned. You can try updating the name of your Firebase app to a shorter name that is less than or equal to 30 characters in length. You can do this by going to your Firebase console and selecting your project, then navigating to the "Project Settings" page and updating the "Firebase SDK Snippet" section with the new app name.
Deepak RawatPosted Apr 17, 2023, 5:14 AM
you have commented out the
const auth = firebase.auth()line, which initializes the Firebase Authentication service. If you want to use Firebase Authentication in your app, you need to uncomment this line.Tuhin PaulPosted Apr 16, 2023, 6:51 AM
Once you have updated your Firebase app name, you can update your code to use the new name
Make sure to replace "new-shorter-firebase-app-name" with your actual Firebase app name.