Question: my iphone won't charge when locked?
Answer: If unlock alerts are nagging you, or if your device fails to charge because you didn't unlock it, the easiest solution is to turn USB Restricted Mode off. Just go into Settings > Touch/Face ID & Passcode and enable USB Accessories.