I got posts in my post node and I've made a wall node for keeping reference to post.
MY CODE:
self.newPostAddedInWallHandel = FIRDatabase.database().reference().child("wall").child(self.myuserid
).observe(.childAdded, with: { (snapshot) in
debugPrint(snapshot)
debugPrint(snapshot.key)
}
Whenever the new post is created , post id is added to wall node and I get the correct snapshot. I've the observer for wall node .childAdded.
NOTE: Everything works fine but when I re-run app. .childAdded observer is called for all the posts in the firebase.
What am I missing here ? Couldn't figure this out ? I don't think .childAdded should be calling again on re-launching the app. Any Suggestions.