iOS 7 really screwed things up for users with third-party charging cables. Although not every user faces a charging issue on their iPhone, there are a lot of people whose iPhones (4, 4s, 5 and sometimes even 5s) stop charging abruptly.
In some isolated cases, it's not even a third-party cable that causes the issue. But whatever it is, it doesn't look nice when your iPhone stops charging after – say – charging a bit or when it doesn't charge at all even when you plug it in.
Trust This Computer Loop / iPhone Not Charging via PC or Laptop
One of the things that happened with my iPhone was that when I connected it to the computer, the Trust this computer dialog popped up. When I tapped on “Trust” thinking that this would be it, the dialog popped up again. And it went on a loop every time I tapped on Trust on the iPhone. Effectively, charging never happened.
Tapping on “Don't trust” solved one part of the issue but it's a bad workaround. When you tap on “Don't trust”, the iPhone stops asking the question (dialog) but it will charge. Unfortunately, you won't be able to sync or apply changes to the iPhone via iTunes. You will have to try a variety of things to get out of the loop. Here's a tutorial on getting out of the loop and charging your iPhone through the PC/Mac.
Are You Charging via Docks?
Since iOS 7 is coded to detect charging devices that are not verified by Apple, unsupported docks are going to be causing charge issues. But this seems to work randomly. Sometimes, charging docks do charge your iPhone for sometime before it stops charging altogether. Seeing the iPhone charge to 30% and then stop charging is not very uncommon when you charge via an unsupported dock.
While there are no clear fixes for this, you can upgrade your charging dock by buying a new one. When you buy, look for the place where it says the charging dock is Apple-certified (MFi).
Slow Charging Issue: Airplane Mode, 12W Chargers
One more issue that goes hand-in-hand with iPhone stopping charging abruptly is slow charging. We thought the error was native to iPad and wrote about it but it looks like iPhone users too face the issue. There are no hard/fast solutions for this either.
The Airplane Mode fix is a smooth workaround. When you charge your iPhone with Airplane Mode turned on, the phone charges fast. It's a well-known trick that people use to charge their smartphones faster. When you find that the iPhone goes from 25% to 26% terribly slowly, put that on the Airplane Mode.
In the meanwhile, you can also try to fix the slow-charging issue by switching between cables. If that doesn't work, it's mostly a hardware issue (with the battery or the boards).
Using an iPad/Mac wall-charger on your iPhone – although not recommended officially – is another way to quicken up the charging process.
Over at iFixit, this post throws some light on how water-damaged iPhones could be throwing up issues with charging.
If your iPhone came into contact with water in a way that made you dry the iPhone for longer than a few hours, you run the risk of having water-damaged parts on the iPhone. Even if you dried the battery long enough, there are other connectors, circuits and parts that interface with the battery. This could be creating issues with charging.
The only safe way to fix this is to take the iPhone to the Apple store.
(Before this, if you could afford the time and the data-loss/recovery, you might want to try restoring your iPhone as new and re-try charging methods to seek a fix).
As a last resort, you might have to replace the battery.