If the flash doesn't work when taking photos on an iPhone, the flash feature of the camera app may be off. To check the flash settings, open the camera app, and tap the lighting bolt icon in the upper-left.
When taking extended video with an iPhone, the phone turns off the flash feature when it becomes too warm to prevent overheating. When this happens, the camera app shows a warning message saying that the phone needs to cool down. IPhones also disable the flash when the environment becomes very warm. In addition, the flash doesn't work if the phone has a faulty flashlight integrated circuit.