So say I am building a web app using React and also a mobile app that allows users to take a photo using React Native. I want to allow users to use the same login credentials when signing into the web app and also the mobile app. Can I use the same Firebase info for both the web app and mobile app? Like just include the snippet below in both code bases to allow them to both use the same database, storage, etc?
<script src="https://www.gstatic.com/firebasejs/3.6.1/firebase.js"></script>
<script>
// Initialize Firebase
// TODO: Replace with your project's customized code snippet
var config = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
storageBucket: "<BUCKET>.appspot.com",
messagingSenderId: "<SENDER_ID>",
};
firebase.initializeApp(config);
</script>
Yes, You can use the same firebase database in more than one android application as below: In the Project Overview section of Firebase Console add an android application. For adding this application first you need to give that package name.
So I'm thinking of using the same database (Firebase) for both for mobile app and web-based system so that any new data added into the Firebase through the website will be automatically updated in the mobile app as well. Is this doable? Yes, you just need to use the Firebase config of same project.
A Firebase project can have one or more Firebase Apps registered to it (for example, both the iOS and Android versions of an app, or both the free and paid versions of an app).
Firebase provides detailed documentation and cross-platform SDKs to help you build and ship apps on Android, iOS, the web, C++, and Unity.
A single Firebase project can be used as the back-end for many (iOS, Web and Android) apps. All these apps will be talking to the same back-end services.
So if you create two web applications on a single Firebase project, those apps will be using the same database, the same list of users, the same stored files, etc. If you then add an iOS or Android app, that will also be accessing the same users/database/files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With