  Exploiting $B$-meson decays for Standard Model tests and beyond requires a
precise understanding of the strong final-state interactions that can be
provided model-independently by means of dispersion theory. This formalism
allows one to deduce the universal pion-pion final-state interactions from the
accurately known $\pi\pi$ phase shifts and, in the scalar sector, a
coupled-channel treatment with the kaon-antikaon system. In this work an
analysis of the decays $\bar B_d^0 \to J/\psi \pi^+\pi^-$ and $\bar B_s^0 \to
J/\psi \pi^+\pi^-$ is presented. We find very good agreement with the data up
to 1.05 GeV with a number of parameters reduced significantly compared to a
phenomenological analysis. In addition, the phases of the amplitudes are
correct by construction, a crucial feature when it comes to studies of $CP$
violation in heavy-meson decays.
