Iphone won't charge after battery replacement

Hi there,
I've just replaced my battery with a non-original one.
After plugging it into power outlet, I saw that the device wasn't charging.
The point is, that it only charges when on.
Can anybody give me a suggestion about what to do now?

Thanks in advance
So it charges, but only while the device is on? Do u mean not in sleep mode?
What do you mean?
If I turn off my phone, and plug, it won't charge.
What do you mean?
If I turn off my phone, and plug, it won't charge.

Well if you turn it off and charge normally it will turn it self back on .. How bout if you plug it in and then turn it off ?

Original thread: https://forums.imore.com/threads/iphone-wont-charge-after-battery-replacement.242607/