How to use Firebase console with a database created using GCP console? - firebase

After creating a Firestore database using GCP console (Google Cloud Platform console) and adding some data there, I don't see my project/database appear in Firebase console.
I just get a screen that prompts to create a new project.
It is required to use Firebase console for certain operations such as editing the security rules.

In Firebase console, click on Create new Project. Under the field for project name, there should be a dropdown menu showing projects created in GCP. Select the project you want and it will add this project to Firebase console without requiring you to create a new project.
The data you already have will still be there and will become accessible from Firebase console.

Related

Should I use GA4 or firebase to configure my app?

I have added my app to GA4 using data streams. It seems it is associated with a firebase project id. But the project doesn't appear in the "Your apps" section of the Firebase console. If I add my app in Firebase section, it generated a different project id.
So is it necesssary to configure both?
In the Firebase console I got somehow two projects with the same name.
It seems that when creating a GA4 property, it will also create the project in the Firebase console.
To answer my own question, when creating a "data stream" for an app, it will automatically add the app to the Firebase console. If not, that because you are in the wrong project.
I guess that if I had added the app to the Firebase console first, it would have been added to the "Data Streams" section for the GA4 also. (As long as the Firebase project is linked to the GA4 property though)

Consolidating Firebase messaging and Google Analytics in Xamarin Forms Android project

In our Xamarin Forms app we have been using Firebase for push notifications for few years. For that purpose, we have a project in Firebase Console.
Now I needed to add Google Analytics (GA4) functionality. Based on documentation, in https://analytics.google.com/ I created a property for our project, and added a data stream for Android platform (and another data stream for iOS also, by the way). That allowed me to download a config file google-services.json to be added to the app project. A new project corresponding to the newly created data stream appeared in the Firebase console.
The problem is that the app project already has google-services.json file used for the push notifications. If I replace it with the new google-services.json, push notifications stop working. If I leave the existing google-services.json, GA4 would not work.
Of course, the google-services.json files differ. The project_number, project_id, storage_bucket, client_id etc are different, and the existing file has
"firebase_url": "https://api-1234567891482864589-273909.firebaseio.com",
which does not exist in the new file. The package_name is the same in both files.
How can I consolidate the projects to make both Firebase functionalities work? I would prefer to keep the newest project.
From document [GA4] Firebase integration
Link Google Analytics 4 properties to Firebase, we could find that :
Create a project
When you create a project in Firebase, you have the option to
integrate with Analytics. If you already have one or more Google
Analytics accounts, you can associate your project with one of those.
If you do not already have a Google Analytics Account, a new one will
be created for you with the name Default Account for Firebase.
Firebase users who have access to that project are given Analytics
user roles based on their Firebase roles (see User access above).
For more, you can check Part : Link your Firebase project to Analytics in above link.
The steps:
Set up a new Analytics link
Open your Firebase project.
Open Project settings > Integrations.
On the Google Analytics card, click Link.
Select an Analytics Account or create a new one.
If you select an existing account, you have the option to select an existing Google Analytics 4 property in that account or to create a new property.
If you create a new account, then a new Google Analytics 4 property is created for you and your project is linked to that property.
Learn more about setup and limits
Configure your Analytics settings.

"Error updating Google" message when trying to enable Google Sign-In for Firebase Authentication

I'm trying to enable the Google Sign-In provider in Firebase Authentication, but it's failing to be enabled when I click Save as I'm getting a "Error updating Google" message.
I have added my SHA1 fingerprint to my Firebase project and I tried enabling the provider in incognito mode, but it still fails. I also checked the Menu -> More tools -> Developer tools for errors, but I don't see any. How do I fix this?
The solution is to recreate the Firebase and Google Cloud projects.
After deleting everything, first create a Firebase project. Then, the Google Cloud project will be created automatically. There is no need to create a separate Google Cloud project.
After this, don't forget to delete and create new SHA-1 and web_client_id keys:
delete the debug.keystore.
run ./gradlew signingreport from the app's directory to make sure there are no keys remaining.
build the app in Android Studio - it will generate new keys automatically during new build.
run ./gradlew signingreport from the app's directory to make sure that new keys are there.
You may also refer to this documentation.

Change Firebase Cloud Message account

I have my android app running firebase cloud message using uat#gmail.com. and now, i need to change the administration to production account bbb#mycompany.com
what i have done, using bbb#mycompany.com to create new project and generate a new google-services.json and replace existing google-services.json i created with aaa#gmail.com
using android studio connect to firebase and show
Firebase: A config file "D:\xxx\xxx\google-services.json" was found, but it indicates a project ID "xxx-1vv" that you dont appear to have access to. Request access or delete the file in order to proceed with the connection process.
anyone could help??
You can transfer ownership of a Cloud (Firebase) product without having to change the way your users user the project. Please read this for details. Note that all Firebase projects are also Cloud projects, so anything you do in the Cloud console applies to Firebase.

new project not showing up Firebase CLI

Was recently added to a new firebase project via the web interface but it isn't showing up in firebase list. I can see the project in my firebase console. I've tried restarting my terminal, logging out/in, and doing firebase use, but no avail.
Any ideas?
Thanks.
firebase-init first asks which features you wish to use, e.g. database, firestore, storage, etc.
If you choose firestore but have not yet enabled Firestore in your newly created Firebase project via firebase.google.com website, that project will not show up as a project option.
So, before running firebase-cli, enable all the features you want via the website first, ...before chosing those features in step 1 of firebase init.
Once you've enabled Firestore, for example, your project will now show up.
There is now a --project option you can use with firebase init to choose the project.
firebase init --project <projectId>
You can select your project if you know the project id:
firebase use --add
That will select the project, so when you type "firebase init" will not show the select project option but take you to the next step
After 24 hrs, the project finally showed up in my list. Turns out there's just an extremely long delay if you're not the owner of the project.
While following the firebase init steps, use the [don't setup a default project] option.
Then use firebase use --add projectId to add the project.
So recently I changed my password, and was still logged into my firebase account, I did firebase logout and then tried firebase login again, and this time the firebase use --add command worked
In case this helps anyone else: a firebase project is just a firebase-enabled Google Cloud Platform project.
You can create a GCP project but it won't appear in the firebase CLI until you visit console.firebase.google.com and enable firebase for your GCP project of choice.
Then
firebase use --add your_google_cloud_platform_project_id
Should detect your project.
When firebase init asks you to choose a project from the list just check [don't setup a default project] and after the installation you can manually add the project to the .firebaserc file as shown below.
{
"projects": {
"default": "your-project-id"
}
}
You can check the id's of your projects with the command firebase list.
It'll also show the current project.
The below solution worked for me.
Get the Project Id from firebase console. e.g. myproject-2233
On Firebase CLI run below command
$ firebase -P myproject-2233
Next Select the features you want to add e.g. Web Hosting
Next Select "Don't Setup a default project"
Give the public folder name
It worked only after choosing "Don't Setup a default project"

Resources