Abstract. We define an almost periodic extension of the Wiener algebras in the quaternionic setting and prove a Wiener-Lévy type theorem for it, as well as extending the theorem to the matrix-valued case. We prove a WienerHopf factorization theorem for the quaternionic matrix-valued Wiener algebras (discrete and continuous) and explore the connection to the Riemann-Hilbert problem in that setting. As applications, we characterize solvability of two classes of quaternionic functional equations and give an explicit formula for the canonical factorization of quaternionic rational matrix functions via realization.