Smartphones and tablets, including the Apple iPhone and iPad, will have to use a USB-C charger from 2024.