Chosen Solution

My phone was no longer charging due to a damaged lightning connector. I just replaced the lightning connector/headphone jack assembly using the part and guide from iFixit. Now the phone works, it is charging properly, the microphone works, headphones work. But the speaker is not working either on a call on speaker phone or playing music. Any ideas?

The speaker makes contact here (note the gold contacts at the top right of the image). Double check to make sure the contacts are lined up properly and clean from body oils (use IPA to clean).