Our trick for getting rid of fruit flies is simple: put three drops of dish soap (whatever kind you use) into 1 cup of vinegar and leave it out in a bowl. The vinegar will attract the flies to the bowl and the soap will reduce the surface tension so the flies sink to the bottom.
I poured about a half of a cup of apple cider vinegar into a small mason jar with about two squirts of dish detergent. I then took a piece of parchment paper or you could use wax paper to seal the mason jar. I then poked holes in the paper with the tip of a pen. This works amazing!! I caught more than three quarters of the fruit flies in my kitchen in less than 24 hours!