Change Firebase Cloud Message account - firebase

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.

Related

"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.

403 when using firebase API to create a project (As an owner user, not a service account)

I am trying to create a firebase project using the api. The document for this is here: https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects/addFirebase
I have created a GCP project already and I am the owner of this project. I can see my project in a request to:
https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/availableProjects/list . It has a project id of: projects/my-project-id-here
I am making the requests as a owner of the GCP project user account (I am not using a service account!) using Google OAuth 2.0 with the correct scopes (You can try it in the documentation), but I am receiving a response of:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
I can create firebase project fine If I go to firebase website directly and create the project there.
Google take 30 days to delete my test projects, so I am restricted to how many times I can try to get this right from scratch. Therefore I am also interested to know how you fully unlink firebase from a GCP project without deleting that project. Removing the service account and disabling the APIs from GCP console doesn't seem to do the trick.
Finally, I do not know if it is relevant but I also have the same user account setup with a developer account on google play and the GCP project is linked up for API access it's created service account granted access. I don't think this is relevant though, as my understanding is that I can setup a firebase project without this.
Hope someone can help!
I've found the solution to this. You cannot use the firebase API to create a firebase project unless you've first accepted the terms and conditions which aren't shown to you until you're in a firebase project (go figure).
Anyway here are some clear steps:
Create a firebase project through the website
Open the firebase project
Accept the terms and conditions for firebase use
Delete the firebase project and enjoy the API now working.
Regarding your interest in removing firebase from a project, this is not supported. The best course of action is to undo the changes that were made when firebase was added, namely disabling the firebase APIs, removing oauth client/brand, removing API keys etc, which you have already done, and it’s the closest thing to deleting the project.

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

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.

Where can i find the link to my newly created app in firebase?

Im trying to locate the link that is supposed to be created along with my app on Firebase(according to the udacity Firebase course).
I found many links but none of them were accepted by the "after lesson quiz" on udacity.
The content that they have is according to the old UI of Firebase so i cant follow it step by step.
Unfortunately that course is for Firebase 2.x (www.firebase.com) and is out of date. In the legacy Firebase docs, under step 5 : Read & Write to your Firebase Database, you can see that creating a Firebase reference required the actual web address for you app. This is no longer true.
The new and correct way to setup your Firebase app does not require you to use this web address. The steps for setting up a Firebase app now are HERE.

"Error: Permission denied" when running firebase init and choosing database

So I’m testing out the CLI today and firebase init with db/hosting selected, and choosing to create a new project, always says Error: Permission denied..
sudo firebase init didn’t help.
firebase-tools version 3.0.3 on OS X 10.11.5.
firebase init
You're about to initialize a Firebase project in this directory:
/Users/splaktar/Git/tmp
Before we get started, keep in mind:
* You are initializing in an existing Firebase project directory
? What Firebase CLI features do you want to setup for this folder? Database: Deploy Firebase Realtime Database Rules
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? What Firebase project do you want to associate as default? [don't setup a default project]
=== Database Setup
Firebase Realtime Database Rules allow you to define how your data should be
structured and when your data can be read from and written to.
? What file should be used for Database Rules? database.rules.json
Error: Permission denied.
I've tried the answers here but they did not help. Is this just a bug in the firebase-tools?
I have the same issue and this is how I fixed it.
run firebase init
Deselect ❯◯ Database: Deploy Firebase Realtime Database Rules
Go through other steps to setup the initial app, selecting the default for each should work just fine.
run firebase serve
Hope that helps.
Sometimes it could happen when .firebaserc file exists.
Remove .firebaserc file and reattempt firebase init.
I was with the same problem, but I was not accessing the right account.
After accessed the right account, I created a new project and run "firebase list" (before this not happened) and my new project was there.
This solved my problem.
You need to have Owner or Editor IAM permission on the GCP project to use firebase init command.
The firebase init command initializes/enables the project to use Cloud Functions/Hosting etc for Firebase. Owners/Editors have higher permissions that allow APIs to be enabled etc.
it is a first-time task when you starting the development, and then init command can be avoided if you have set up your cloud functions code in VCS for multiple developers or you.
i.e, Usually after writing code, you will replicate the project to other developers, who will then also write code and use firebase use yourprojectid further.

Resources