EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

New Firebase project is not being picked up #1567

Open saleemepoch opened 4 years ago

saleemepoch commented 4 years ago

I am working with Master Detail with Firebase Angular template, and I can successfully build the app locally.

But then when I try to reconfigure the app for my own firebase project, nothing seems to change. It continues to query the default app's firebase.

I have followed the instructions for changing firebase app to my own to the letter but I cannot figure out why it still keeps pointing to the old app.

These are the steps I take to change the firebase app:

  1. I create an App in Firebase, using the app id from package.json.

  2. I download google-services.json and copy it to App_Resources/Android/google-services.json

  3. Additionally, I delete google-services.json from platforms/android/app, just in case.

  4. I uninstall the previously installed App from the emulator. I event deleted and created a new emulator to make sure there are no remnants of the previously built app.

  5. I search all the files in the project for any reference for https://car-rental-b26b7.firebaseio.com which is the default firebase app that comes with the template, and I don't find anything at all.

  6. I also edited firebase.common.ts with the following upon successful initialisation:

.then((instance) => console.log("firebase.init done", instance),

Just to see which project its initialising.

  1. Finally, I build: tns run android

And sure enough, the console log shows https://car-rental-b26b7.firebaseio.com as the project being initialised.

I know for definite it is copying the new project's google-services.json over to platforms/android/app, because when I deleted the file it refused to build, as expected. Placing the file back, it builds successfully.

But I have no idea why it continues to reference the original firebase project.

Has anyone come across something similar?

manojdcoder commented 4 years ago

Did you go through the setup instructions and installed your own version of JSON and info plist files?

FYI, It's not only the URL there are other details in those files used to connect to your project.

saleemepoch commented 4 years ago

I didn't follow the separation of environments section because that's not what I am after. There is only one environment locally which should connect to only one Firebase project.

In that respect, I did replace the old json with the one I generated from Firebase for my new project but no joy.