How to fix iPhone charging port with pencil | Loose connection | iPhone

If your iPhone 5, 6, 7 or the new iPhone and X isn't charging. It may be because of dust compacted in the charging socket of your phone.

In this a simple solution saved me a trip to Apple for a repair.