We report the detection of OH+ and H2O+ in the z=0.89 absorber toward the lensed quasar PKS1830-211. The abundance ratio of OH+ and H2O+ is used to quantify the molecular hydrogen fraction (fH2) and the cosmic-ray ionization rate of atomic hydrogen (zH) along two lines of sight, located at ~2 kpc and ~4 kpc to either side of the absorbers center. The molecular fraction decreases outwards, from ~0.04 to ~0.02, comparable to values measured in the Milky Way at similar galactocentric radii. For zH, we find values of ~2x10^-14 s^-1 and ~3x10^-15 s^-1, respectively, which are slightly higher than in the Milky Way at comparable galactocentric radii, possibly due to a higher average star formation activity in the z=0.89 absorber. The ALMA observations of OH+, H2O+, and other hydrides toward PKS1830-211 reveal the multi-phase composition of the absorbing gas. Taking the column density ratios along the southwest and northeast lines of sight as a proxy of molecular fraction, we classify the species ArH+, OH+, H2Cl+, H2O+, CH, and HF as tracing gases increasingly more molecular. Incidentally, our data allow us to improve the accuracy of H2O+ rest frequencies and thus refine the spectroscopic parameters.