[FIRApp appWasConfiguredTwice:usingOptions:] - Default app has already been configured
crash - could this be handled more gracefully?
#13132
Labels
Description
Recently while moving to
SceneDelgate
on our end we movedFirebaseApp.configure()
to a place where it can be called again during app lifecycle (mainly if app is suspended and then comes from background and rebuilds whole stack).We haven't noticed that during development, but when shipped on AppStore we started getting crashes
Default app has already been configured.
. This is being called from[FIRApp appWasConfiguredTwice:usingOptions:]
which comes through few methods fromFirebaseApp.configure()
.Is there really any reason why third-party SDK library should be manually throwing
fatalError
instead ofnonFatal
or just producing warning and doing nothing in case configuration is happening again even tho app is configured?As a solution we added check
if FirebaseApp.app() == nil
- but this (or even more nicely) could be handled right inside the SDK.There is no reason why Firebase SDK should be crashing the app in these cases.
Reproducing the issue
Call
FirebaseApp.configure()
twice in the code.Firebase SDK Version
10.27.0
Xcode Version
15.4
Installation Method
Swift Package Manager
Firebase Product(s)
All
Targeted Platforms
All
Relevant Log Output
The text was updated successfully, but these errors were encountered: