Chosen Solution

After I installed my new front camera on my iPhone 7 plus, the camera sometimes works and then sometimes not, on top of that, Snapchat crashes every time I switch the camera to the front one. It is really annoying and I would like it fixed soon!

Two main things I would typically suspect, first would be a loose connection between the camera and logic board or dirt in the socket, second would be that maybe you got a faulty camera, it does happen from time to time. Third less likely thing is that something is damaged on the logic board, whether it be bent pins in the connector socket or some other issue with it. I would re-seat the connector, inspect both the board and cable to make sure nothing obvious is wrong with the connections, and if that doesn’t help try another camera. Out of curiosity, why did you need to replace the camera in the first place? I don’t typically see them go bad unless the screen breaks around them and they experience physical damage.