  In the inhomogeneous Universe, the cosmological conversion of dark photons
into ordinary photons (and vice versa) may happen at a great number of
resonance redshifts. This alters the CMB observed energy spectrum and degree of
small-scale anisotropies. We utilize results from the EAGLE simulation to
obtain the conversion probability along random line-of-sights to quantify these
effects. We then apply our results to the case where dark photons are sourced
by dark matter decay and their high-redshift conversion into ordinary photons
modify the global 21 cm signal expected from the cosmic dawn era. Concretely,
we show that a significant portion of the parameter space for which a converted
population of photons in the Rayleigh-Jeans tail of the CMB explains the
absorption strength observed by EDGES, is ruled out from the brightness
temperature measurements of COBE/FIRAS and the CMB anisotropy measurements of
Planck and SPT.
