Customers flocked to buy the iPhone 6 and iPhone 6 plus when it was launched in Hong Kong last September, despite criticism of the products / Getty

The camera could also upgrade the resolution and video recording capabilities of the ‘selfie camera’

The next iPhone could offer a flash on its front facing camera, according to code found buried in early releases of the operating system that will run on it.

The feature, which will allow people to take selfies in the dark, was found in early releases of iOS 9. The same code seems to indicate that the phone will receive an update to a 1080p camera, from the existing 720p one, and support for panoramic selfies and slow motion video.

Apple has long worked to improve the back-facing camera, promoting it in a recent range of high-profile ads. That camera is also set to improve big improvements in the next iPhone, including a jump in resolution, and it has acquired technology like improved low-light sensors that could appear in the next hardware.

But the front-facing camera — originally advertised as being useful for video chat, though used too to take selfies — has lagged behind. Competitors have offered upgrades to their front facing cameras, and many other phones integrate features built especially for taking selfies, like gesture control for when phones are slotted into selfie sticks, as found in LG’s G4.

Clues to features that are coming to new iPhones are often found as developers dig around the code for the next version of iOS. iOS 9 was announced earlier this week and given to developers at the same time, but the company won’t announce the iPhone until probably August or September.

For the first time, the company will be giving the public a chance to try the new version of iOS before the next iPhone comes out. Apple is offering a special beta programme for members of the public to join.