iPhone XS Max sometimes doesn't want to charge
When I connect my phone to a charger, it says it's charging, but the battery percentage doesn't go up, stays the same, or goes down after a while.
Yesterday my phone had 10% battery left, I connected it to a charger, the phone said it was charging, I've left it for a few hours and it dropped to 0 and the phone turned off. I unplugged the charger, and after powering the phone on there was no battery left screen with the charging wire, I've connected the charger again, and the charging wire disappeared from the screen. The phone turned on but only charged to 1%.
In the morning I've connected the phone to the charger again and it was charging normally