I am working on an iOS app and I have built my project on top of Firebase\'s login-demo app. I can authenticate with Facebook, and communicate with Firebase just fine. When I pr
I've never used the Firebase iOS SDK, but it most likely works in a similar way to the other SDKs.
If that is the case, the listener block that you registered, stays registered when the user logs out. Then when the user logs in again, you are registering a second event listener. So from that moment on, your code block will execute twice for every added child.
You should unregister/cancel the event listeners when the user logs out (https://www.firebase.com/docs/ios/api/#firebase_removeAllObservers) or simply not re-register them again if you've already registered them before.
See the Firebase guide for iOS, specifically the section on detaching blocks: https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-detaching