I had this exact same problem, but im pretty sure i found a solution, i was repair my power button flex cable and ripped it, when the new one came in i had put the little GOLD grounding pin for the camera in wrong, i reopened my i phone and changed it to the right place, IPHONE repair miami beach did a great video on how to remove the flex cable and you can see where the little gold peice is when they remove the rear camera, i would check that and double check and make sure you put all the screws back in the right spot. Opening your phone does void your warrenty so if you havent opened your phone i would HIGHLY recommend to check with apple first to see if you are still under warrenty or at least take it into an apple store, here is the video as well as there site is in the description where you can get replacement parts. i hope this works for you all like it has for me. GOOD LUCK!
If you have any questions feel free to email me
<Email Edited by Host>