Chosen Solution

I recently replaced my battery with one I bought from ifixit. It worked fine for a few weeks but suddenly it stopped charging. When I connect the charger it indicates that it charges but the battery does not charge at all. I opened the phone, disconnected and reconnected the battery and it seemed to be OK for the next weeks. Since yesterday I have the same problem again and the same trick did not do anything at all. Any ideas? Update (11/23/2019) Thank you all for your help. An update: I checked the charger port flex cable which seems fine. Then I disconnected the battery and when I plug the charger the phone shows the apple logo. The battery cable also seems to be OK. Maybe the battery itself is faulty? Should I ask for a replacement battery?

Make sure lighting cable is not damage. Check the lightning port for dust and check to make sure the flex cable is not damaged or bent. Check battery cable is not damaged.

check the charger port flex cable , it maybe not connect properly . beside the battery connector

Try to get a replacement