Is it possible for multiple android applications to access a single firebase backend. If no what is the alternative in such situation?
Yes, it is possible. Go to your firebase console. Select home tab. Click on Add App. Select Add firebase to your Android App. Provide the necessary details for the package name. Download the latest config file and add it to all the android apps connected to this firebase project.
Yes, you only need to setup your Firebase object with the same url(db).
Check the documentation for more. https://www.firebase.com/docs/android/guide/retrieving-data.html
With Android Studio 2.2 and upwards you can easily create and add apps to you Firebase project without leaving your work environment and no need to download google-services.json
From Android Studio go to Tools->Firebase and create, add apps to project of choice :)
Guide
Yes, it is possible for multiple applications to access the same Firebase Database.
From Android Studio v2.2 onwards, you can directly link an app to a Firebase database via the Firebase Assistant.
Here is how to do so:
Go to Tools and click on the Firebase option.
From the Firebase Assistant, select Realtime Database
Click on the Connect to Firebase button in the Assistant, which will show you a dialog allowing you to select an existing Database or create a new database. Click on Choose an existing Firebase project, select the Database you want to use and click on the Connect to Firebase button in the dialog.
Your app will automatically get connected and you will be able to access your database.
In the firebase console you’ll be having the option to connect the firebase to corresponding platform and it’s configuration. You can use that to add same firebase project to any desired platform.
Yes, it is! a single firebase database can be access by multiple app.. provided each of your apps use the same authentication details. The Firebase documentation will be a big help. https://firebase.google.com/docs/
I have 2 of my app accessing 1 firebase database account, so, i am quite sure it will work for you my friend!
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.
Download config file in JSON format.
Note: you must be download a new copy of JSON because in that JSON
file included package name of your application and all.
Add some repository and implementation in both(Project/Module) build.gradle file.
Ready to access firebase database in new android application.
Click Add App Button and first option Choose your App platform.
Second step Register you application paste your app package name.
And third step download the google config file the file paste your
project's app folder and start your second application.
Related
I am looking for help merging Firebase projects.
Current Setup: There are two different projects (iOS & Android) on two different accounts.
Firebase Project 1: iOS App using account abc#gmail.com
Firebase Project 2: Android App using account xyz#gmail.com
Goal: Combine both apps into a single Firebase project. Firebase Project: iOS and Android App using Account abc#gmail.com
Please help me with this. Thanks
Note:- I am able to move one project from one account to another account.
There isn't a way to merge projects. In this case, if you want to have both apps in one project, lets say "Firebase project 1", you will need to create an Android app in "Firebase project 1" with the same package name. Then update the app with the new google-services.json file. With this you will have both apps under the same project but note that historical data won't be available.
If you are using Authentication, you may need to export the Auth info, see this reference.
Similarly, you can do this also for Firestore.
Not all the Firebase products have an option for exporting/importing data, so keep that in mind.
That's my concern, currently I'm developing an application that uses Firebase. Recently my identifiers for Android no longer work, the error tells me that the App ID does not match, however I am using google-services.json provides from my firebase console after adding my android application with its SHA key- 1.
My file is inside android/app folder like Firebase want it.
I have no problem with my iOS application, everything works fine.
Do you think I should try to delete Android ID clients OAuth 2.0 from google cloud platform and try to recreate it ?
it works, delete and recreate everything works, because Firebase works independently : if you delete an app inside your firebase console, it doesn't delete it inside google cloud platform.
My application has many flavor that has different application id. I want to register these applications to create to Firebase project.
I want to automate below process:
Create android application in Firebase project.
Enable crashlytics for the applitaion.
Download google-service.json of the project.
Firebase Management API seems to be able to first one, but other can't. I try using puppeteer to control Firebase console in browser, but google prevent to log in by automated browser.
Is there any other solution?
To download google-services.json, you can call projects.androidApps.getConfig from the management API.
For the second one, it's currently not possible. Contact Firebase support to file a feature request.
I need to change Firebase Project of production app with google authentication.
My app is working with a firebase project and a backend server from which I can force users to update my app to the latest version after login with version the user has. Because of that, I hope I can change the Firebase project where I do the authentication with Google.
I can't use old pair Package Name / SHA-1 in new Firebase project, but I can use old package name with NEW SHA-1, right?
So, users with old versions will login with old firebase project and after upgrade my app they will login with with new firebase project, right?
If so, users won't need to uninstall my app, right?
Now, how can I change the SHA-1 in Android Studio?
What I understand you are trying to do is the following.
You want to associate your app to new firebase project
You want to keep you old user base intact.
You have asked if you can change the SHA-1 of the app the answer is no without changing the signature of the app that could change everything and is not an option.
What you could do instead is use two different firebase projects in a single app and write your own logic to manage the users. You can follow this link https://firebase.googleblog.com/2016/12/working-with-multiple-firebase-projects-in-an-android-app.html here the author has explained how to go about it. you can also look up for similar solutions or arounds for the problem. Hope this helps in some way and please try to make you questions precise.
Correct me if I understood your need wrongly!
You have users and want to sign them in to a new firebase project with interrupting your current users?!
I believe what you need to use is the custom Firebase authentication
whenever the user logs in, you produce a token in you current project and pass it on to the new project.
As for:
backend server from which I can force users to update my app
you can also achieve this in firebase, hopefully the backend server is not just for this!
I am trying to connect to Firebase from Android Studio Assistance but getting following error despite having internet connection.
Firebase
A config file "G:\ANDROID\GoFishing\app\google-services.json" was found, but it indicates a project ID "gofishing-149406" that you don't appear to have access to. Request access or delete the file in order to proceed with the connection process.
just Delete that config and go again to firebase console and download a new file and make sure that you have given the access to the project if done problem solved if not make sure that you are not usinfg the the package which was already integrated and restricted access for another apps if so create a a new package and do the same process
if it wont help
just delete that file (config) and go to assistant and click on connect to fire base and give all the credentials and give the new name to package and go with it every thing runs properly
hope it will hep you for sure
Just delete "google-services.json" file in "app" folder of your project and reconnect your app to Firebase with Assistant
This was happening to me because the account I used to login to Android Studio (the account in the most top right) that was not the account I created the firebase account with.
As soon as I logged in to my firebase account in android studio it asked to sync and it worked fine
You will receive this error if you have open different accounts between Android Studio and Firebase. Because the Firebase assistant attempts to contact the Firebase service with your account registered in Android Studio. You can resolve this error by selecting the Add account option in Android Studio.