I have created an Xcode project and implemented firebase. I have copied the project and renamed it. I have created a new firebase project and i have replaced the Firebase config whatever info.plist. I have reinstalled the pods. I checked the code looking for a reference to the database. And after all this work the new application still uses the old database from the previous project. When i create a new user it is added in the old project. Somebody has any clue? I dont wanna share the code
Asked
Active
Viewed 58 times
2 Answers
0
I'm assuming you're trying to access your database directly using the REST API. GCP checks your credentials to know which database you're accessing.
- If you're running your app locally there are a couple ways you could be using to connect to the database. If you're using service account key, authentication will be done accessing the 'GOOGLE_APPLICATION_CREDENTIALS' variable in your environment. You might need to change that to a new service key of your new project. Watch out as these keys give full access to your database. You can check other access options here: https://firebase.google.com/docs/firestore/use-rest-api.
- If you're accessing a local emulator (which I find unlikely), you can find more info here: https://firebase.google.com/docs/emulator-suite/connect_firestore
- If you're having this problem on the deployed app, GCP will use by default the app engine service account to try and access the project's database. You might be constructing your Firestore API referencing the name of another project. This would probably only work if you've done this: google function: accessing firestore database of another project.

Carlos Chaves
- 51
- 2
- 4
-
I dont use firebase-cli i am talking about the firebase project and the ios one. I wanna know what do i have to change in xcode or firebase. i never used the stuff you told me here as i observed it uses firestore-cli – Dmitri Malashenko Jun 17 '21 at 19:42
0
1- You have to be sure that you've changed the rules related to the database which is located here:
2- Make sure that once you created the app in firebase you've used the same bundle identifier
3- You can't use two different databases on the same project
4- Don't forget to enable the database and users in the new project

Menaim
- 937
- 7
- 28
-
Its not about the rules, its the fact that i copied an old project and renamed it. i have changed the google whatever info.plist and replaced it so it should use the database of the new project not the old one – Dmitri Malashenko Jun 17 '21 at 19:50