It will depend a lot on how you thought your architecture, but if it’s a situation where ADM is always with the app/page open, keep a Childeventlistener attached to your database reference, and at the events of the Software you work with the new data that comes. I’ll put the code snippet of the Google sample below for understanding, it’s the same that I always use in my apps. Regarding notification of new items, use Notificationcompat itself to notify the user in the onChildAdded event:
ChildEventListener childEventListener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {
//Evento que vai mostrar toda child que for adicionada na Reference.
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String previousChildName) {
//Evento que vai mostrar toda child que foi modificada.
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
//Evento que vai mostrar toda child que for removida da Reference.
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String previousChildName) {
//Evento que vai mostrar toda child que for reordenada na Reference. Particularmente nunca utilizei este evento.
}
@Override
public void onCancelled(DatabaseError databaseError) {
//Evento que vai mostrar todo erro que acontecer no banco de dados.
}
};
ref.addChildEventListener(childEventListener);