user7354286
user7354286

Reputation: 25

Firebase 'child_removed' event listener not working

'child_added' works fine, but 'child_removed' does not work.

The data index is ".indexOn": "status".

All three 'child_removed' in the above code will not work. Is it a problem to set the ref target? Or is it a problem with setting indexOn? (Setting indexOn is required)

Upvotes: 1

Views: 746

Answers (1)

arneson
arneson

Reputation: 141

Do you mean that child_moved events are not fired? Because that is what you are listening for.

If it is removal of children you are interested, try listening for child_removed instead of child_moved.

Ex:

notiRef.on('child_removed', function(snapshot) {
      // probably will work.
});

Upvotes: 1

Related Questions