Chosen Solution
After about 8-9 months of use of my iPhone 7, my back camera stopped functioning, and so did my flashlight. I had some experience repairing phones so I bought a third party iPhone 7 camera and replaced it myself, this however did not bring back camera functionality, however it did bring back flashlight functionality. I still would like to have camera functionality though. Has anyone else had these types of problems and does anyone have any suggestions?
For the flashlight to work it needs a working rear camera so it’s kind of weird that the flash started working after the replacement. I would recommend trying a third party application to see if the camera works on those apps instead, such as snapchat, whatsapp, instagram, messenger or whatever. if the camera works on other applications it could be either software problem or PCB problem i guess.
here’s another ifixit thread with more or less same problem but for the 7 Plus that might help you. Why does my iPhone 7 Plus rear camera show black screen?