Chosen Solution

when ever i open front camera my app get froze up and flash not working. i had recently replaced my iphone’s battery. after that its not working is that a software issue or should i need to change the hardware cause other sensors are working ok.

Usually it’s either the front camera cable assembly going bad or just needs the connector reseated to the board. Try getting it replaced and see if that fixes the problem. iPhone 7 Front Camera and Sensor Cable Replacement iPhone 7 Front Camera and Sensor Cable