Chosen Solution

What could be the problem? iPhone sometimes charges and sometimes it doesnt. If I plug it before I sleep it doesn’t show that it’s charging but when I wake up sometimes it will be fully charged already. When I connect it to a computer it gets connected but still not charging

A lot of things can cause this. You will need to rule out a faulty part first. ·         Charging cable. ·         Battery. ·         Charge port assembly. If it is still behaving the same it will be a logic board problem and will need to be looked at by a reputable repairer.