Learn Courses My Dashboard

Couldn't find a valid Google Service.plist

I have an Firebase project with 2 apps, same project ID, different bundle ID. The first created app works fine, but at the second one where I want to create some data to database, I retrieve this nice error:

Thread 1: "FirebaseApp.configure() could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/."

I tried to modify the Workspace settings and many other things as some people said on Stackoverflow and GitHub, but none of them worked for me. Its not a syntactical problem like in the another topic where the issue was an lowercased “i”. I have also deleted the Google Service plist file from Build Phases → Copy Bundle resources and hasn’t worked either, I put it back after.

Two apps share the same project ID, I created the second app in the First app project, add pod files and so on, I dragged the Google Service plist file with copy items if needed checked in the app where is his place…So I have no idea what I have done wrong. I would have provided you with screenshots, but I hope I was detailed enough with this issue and is not needed.

Thank you!

Why do you have two apps with the same project ID?

The GoogleService-Info.plist is specific to a bundleID, and because you have two different ones that’s probably why it’s not valid

If you look at the contents of the plist file that can confirm this

Well, the first app is the one who will be published, and instead of each user sending api requests to the API provider, I wanted to create a second app where I am the only one who can send API requests, and that second app just updates data in Firebase Database, and the published app just takes its needed data from there. I update the general data which is changing daily, and update it when the day ends. Its much more profitable if I do this, because otherwise, if there are 10 000 users, there will be 10 000 requests, instead of one.

I read on forums that you can have 2 apps or more who share the same database, is true right?

Instead of making a second app, you could just have a “hidden” part of your code. UI that only appears in debug rather than release mode, and submit updates there

Yes two apps can use the same database, but do you have two different bundle IDs for your apps? (Which I’m assuming you do because no 2 can be alike)

Is this you updating the app rather than users??
If there’s 10 000 users they’ll all be using the single API key to get data and that’ll be 10 000 requests

Your ideea is much more better, with a UI that only appears in debug, thanks.
And yes, I have two different Bundle IDs, I solved that problem too, It a was something from Google AdMob SDK (I don’t know why), and after I added to my project that SDK, everything draw to a good end.