No effective herb has yet grown against the maggots of the fruit fly. If you want to have maggot-free fruit, in some cases the only solution is to treat it with a pesticide that is not harmless to the environment.

If possible, prevent!
One of the most important pests of the cherry tree is the fruit fly, whose maggots make the cherries inedible. Since the annoying insect swarms out between the end of May and the beginning of July, depending on the temperature, the first preventive measure is to plant the early varieties whose fruiting is already complete by the flight season.
The complete wrapping of the cherry tree with a close-meshed net has proven to be an effective preventive measure. However, this measure is only applicable to relatively small trees. For the home garden we recommend the so-called "yellow boards", which hang in the tree and attract the flies that stick to them.
When splashing cannot be avoided
If prevention is not possible, e.g. B. with an old cherry tree population, the gardener has no choice but to treat the fruit with a suitable spray if you do not want to do without the harvest. For this purpose, appropriate sprays are offered for use in a home garden.
The sprays are not ecologically harmless, since their use also attacks the beneficial organisms and damages adjacent plantings and, last but not least, can have an impact on people's health. Each gardener should make their own decision as to whether or not to use the "chemical mace", bearing in mind that spraying is only effective if it covers all crops.
The spraying is carried out at the beginning of the flight time of the fruit flies. Under no circumstances should the plants be sprayed during flowering. Spraying is best carried out when the sky is overcast and the wind is calm. It is good if the surface of the plant is damp from dew or rain, because then the broth will spread better. It makes sense to use a commercially available spray pump and protective clothing.
tips and tricks
On the Internet you can find numerous recommendations from hobby gardeners that Dr. Use Stähler Mospilan SG against the fruit fly.