0

I want to remove the push value generated from firebase.Can I able to do that and how?

enter image description here

When user follow someone, I write some code to generate push value to firebase for notification. The problem is I didn't written code for removing the value when user unfollow and follows the user again and again it shows lots of notification ..like pic down below

    HashMap<String ,String> notificationData = new HashMap<>();
            notificationData.put("from",FirebaseAuth.getInstance().getCurrentUser().getUid());
            notificationData.put("type","following");
            mNotification.child(mUser.getUser_id()).push().setValue(notificationData).addOnSuccessListener(new OnSuccessListener<Void>() {
                @Override
                public void onSuccess(Void aVoid) {
                    setFollowing();
                }
            }).addOnFailureListener(new OnFailureListener() {
                @Override
                public void onFailure(@NonNull Exception e) {

                }
            });

enter image description here

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

0 Answers0