Welcome to the Apple Support Communities!
I understand you are unable to use the mic on your iPhone unless it is being charged. Is this only happening with SnapChat? Are you saying that you can't make a phone call unless your iPhone is plugged into power? If so, you may need to have an Apple Genius or an Apple Authorized Service Provider take a look at your iPhone. Click on the "Service and Support" section of the resource below to find one near you.
Find Locations - Service - Apple Stores and Apple Authorized Service Providers
If the microphones on your iPhone, iPad, and iPod touch aren't working
iPhone Battery and Performance
Battery Health
For iPhone 6 and later, iOS 11.3 and later add new features to show battery health and recommend if a battery needs to be replaced. These can be found in Settings > Battery > Battery Health.
Take care.