-
Notifications
You must be signed in to change notification settings - Fork 1.6k
FirebaseApp.configure(options: options) not loads data when passing FirebaseOptions #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The plist file must be named GoogleService-Info.plist. If you have multiple, an option is to put them in different folders. |
And is there any reason why it should be named exactly like that? The init(contentsOfFile:) could parse any plist, if given in a right path. |
I don't think it must be named "GoogleService-Info.plist". Can you check whether the plist file is in the correct bundle or linked properly? |
So it is a different issue after all. |
BTW this is console output after
|
Currently, Firebase Analytics depends on the |
FirebaseCore is checking for GoogleService-Info.plist by name at https://github.com/firebase/firebase-ios-sdk/blob/master/Firebase/Core/FIROptions.m#L103 |
@paulb777 I believe that this check is executed only when you are loading default plist, than it should be named "GoogleService-Info.plist" @ryanwilson Ok, thank you for this insight :) |
If it doesn't pass the Options from the plist, then the options is probably wrong. Did you rename the GoogleService-Info.plist that you downloaded from the Firebase dashboard? Did you see any logs in this init: https://github.com/firebase/firebase-ios-sdk/blob/master/Firebase/Core/FIROptions.m#L206 |
Sorry, I have just noticed the log @ashhanai gave us:
So it looks like the GoogleService-Info.plist was parsed just fine. There is no problem with Firebase Core. |
Does that mean we can not use multi config files in our projects (each file for an environment)? |
You can, you just may miss out on very early analytics info. |
Closing due to inactivity. |
please reopen this, its better to have different plist files than store same files in different folders |
@useeless37 you can create FIRApp instances from different plist files. Analytics in particular uses one of a specific name to capture events very early on in the app lifecycle. |
Please correct me if I am wrong, but for a project with multiple build configs (dev VS prod) and targets (say Pokemon Black VS White), each config / target has its own bundle ID and Google app ID, and thus we have to have different plists for each target. For a project with single target and multiple configs (dev VS prod), we cannot put the So, putting |
According to the "Getting Started" guide at home page. https://firebase.google.com/docs/configure/#use_multiple_projects_in_your_application
But according to reply above from @ryanwilson , there is no workaround at this moment. Please fix Google Analytics for Firebase uses runtime configuration. |
There is a warning underneath that section of the Getting Started guide mentioning:
That being said, I agree that we should be fixing Analytics to ensure it can handle runtime configuration changes. We're going to work with the Analytics team to find an acceptable solution that hopefully won't risk the integrity of data coming from Analytics. |
I have created following "workaround". Then I have file GoogleService-Info.plist - which is empty and this file is referenced in XCode. Sure, this only helps when you want to switch file before build - not on runtime. |
Little bit more insight on that one. I have project with Firebase and switching names in runtime using It was working well on Xcode 9.4.1, but after update to Xcode 10 I have an output And debugview at firebase panel doesn't even see the device (simulator ¯_(ツ)_/¯) |
I'd like to bump this, the issue seems to have been open a year ago. We're also struggling with this, we might implement the Our goal is to be able to switch environment at runtime and even though the api looks like it's build for it
The best case scenario I would love to see:
were the static helper would simply call
I understand their could be "lost" analytics, but that's just our responsibility to call configuration as soon as possible.
|
Seems like |
@lifely thanks for the update and the clear goal. It's still an ongoing discussion and I'll update with more as it progresses, thanks! @forsen thanks for bringing that to our attention - looks like the line in question is firebase-ios-sdk/Firebase/DynamicLinks/FDLURLComponents/FIRDynamicLinkComponentsKeyProvider.m Line 29 in c724f9d
This can and should be avoided, I'll file an issue for it separately. |
@arthurgivigir I am also having same issue. |
Any updates on runtime configuration? |
Any updates on changing/setting configuration at runtime? |
I just did log event successfully in Debug View at firebase console as following:
Then used Every thing seems initialized and correctly configured even in Xcode logs, but FirebaseAnalytics logs tell something else 🙃 ?
I don't event have GoogleService-Info.plist in the project. |
+1, seeing this issue for ages:
We use two different plist configurations within a single target just to toggle it in runtime between different stages – even in TestFlight where builds can be treated either as for a Sandbox project (for testers in TestFlight) or for a Production project (when the same build goes live to the App Store). Pls give this a bit of prio to address it already. 🙏 |
Is there any update on this subject? It's open since 2017.. |
Any update? |
I want to bump this due to the performance aspect of this. Firebase initialization takes around 30 ms on iOS to initialize. When passing options via constants this can be slashed almost to a half. Firebase is usually initialized in AppDelegate, which is critical for app start time. Reading and parsing XML plist files is very inefficient on the main thread. |
Thanks @mkj-is Can you show the Instruments logs where you measured the slow plist reading and parsing? |
Any update? |
any update ? |
@paulb777 We added telemetry to measure Firebase initialization (
We have these dependencies and we link Firebase statically. We are not leveraging many of these sub-dependencies. Most of them are transitive dependecies of FirebasePerformance or Crashlytics.
|
I need this as well. But I guess this is never coming since it has been open since 2017 |
I can believe the last time I've stumbled on this was 2018, 7 years later i find myself coming back here. |
i faced the same error 🥲 |
Can I initiate Firebase with options without the file |
Ditto; what's the latest status here? Working on an open-source app that I want to use Firebase Analytics with but would prefer to use Environment Variables and not the info plist |
Describe your environment
Describe the problem
In my app, I have more targets and configurations which require more GoogleServices-Info.plists. I have them all downloaded from firebase console after registering new apps.
On app launch, I am trying to load FirebaseOptions from plist at file path via
FirebaseOptions(contentsOfFile: plistPath)
. Finding plistPath viaBundle.main.path(forResource: plistName, ofType: "plist")
(every plist have different name). Although path to plist is found and init is returning FirebaseOptions instance, returned instance is empty.FirebaseApp.configure(options: options)
is then complaining about not finding plist named GoogleService-Info.plist.Steps to reproduce:
PlistName is different than GoogleService-Info.
The text was updated successfully, but these errors were encountered: