title: 'FIRAppNotConfigured', reason: 'Failed to get default Firebase Database instance. Must call `[FIRApp configure]` (`FirebaseApp.configure()` in Swift)
body: <p>I have development and production firebase projects, and I am managing using below method,</p>
  
  <p>In my AppDelegate didFinishLaunchingWithOptions,</p>
  
  <pre><code>// Configure with manual options.
      let secondaryOptions = FirebaseOptions(googleAppID: "1:82121212:ios:212121212121212", gcmSenderID: "872909116998")
      secondaryOptions.bundleID = "com.testApp.test"
      secondaryOptions.apiKey = "AIzasskjkkjhkdhksadhsadaskdhks"
      secondaryOptions.clientID = "82121212-asdsdasdasdasdasdadsdsd.apps.googleusercontent.com"
      secondaryOptions.databaseURL = "https://test-myApp.firebaseio.com"
      secondaryOptions.storageBucket = "test-myApp.appspot.com"
  
      // Configure an alternative FIRApp.
      FirebaseApp.configure(name: "secondary", options: secondaryOptions)
      guard let secondary = FirebaseApp.app(name: "secondary")
          else { assert(false, "Could not retrieve secondary app") }
      let secondaryDb = Database.database(app: secondary)
  </code></pre>
  
  <p>and in my another view controller while fetching messages from the firebase database my application is crashing with 
  "*** Terminating app due to uncaught exception 'FIRAppNotConfigured', reason: 'Failed to get default Firebase Database instance. Must call <code>[FIRApp configure]</code> (<code>FirebaseApp.configure()</code> in Swift) before using Firebase Database.'"</p>
  
  <p>my ChatViewController</p>
  
  <pre><code>class ChatViewController : UIViewController {
  
  var ref : DatabaseReference!
  override func viewDidLoad() {
      super.viewDidLoad()
      getChatMessages()
  }
  
  @objc func getChatMessages() {
  
      firebase = Database.database().reference(fromURL: url)
      Auth.auth().signIn(withCustomToken: firBaseAuthToken, completion: { (user, error) in
          if error != nil{
          }
          else
          {
              let userAuthData = user?.additionalUserInfo
              self.uid = (user?.user.uid)!.replacingOccurrences(of: ".", with: "")
              self.successFireBaseAuth(urlString: klUrl)
          }
      })
  
  }
  
  func successFireBaseAuth(urlString : String)
  {
      ref = Database.database().reference(withPath: urlString)
  
  
      ref.observe(.value, with: { snapshot in
   })
  }
  </code></pre>