Apple CEO Tim Cook has said he is "deeply offended" by allegations made by the BBC that workers on the iPhone-maker's Chinese assemble lines were bullied, mistreated and forced to work long hours.

The Panorama episode aired on 18 December featured undercover reporters sent to work in a factory in Shanghai owned by Pegatron, one of Apple's manufacturing partners used to produce the iPhone, iPad and Mac product lines.

Secret filming revealed poor working conditions, cramped dormitories, exhausted employees sleeping on the job, and exposed a link between Apple and illegal tin mining in Indonesia.

An email sent by Jeff Williams, Apple's senior vice president of operations, to around 5,000 staff across the UK said he and Cook were both "deeply offended by the suggestion that Apple would break a promise to the workers in our supply chain or mislead consumers in any way."

Claims 'could not be further from the truth'

The email, published by the Telegraph, went on: "Panorama's report implied that Apple isn't improving working conditions. Let me tell you, nothing could be further from the truth."

Panorama said national ID cards required to be held by Chinese citizens at all times, were confiscated from them upon applying to work at the factory - something Apple says does not happen - and it was also alleged that workers fell asleep during 12 hour shifts, and in some cases worked for 18 days straight after being denied requests for days off.

Williams claimed Apple shared "facts and perspective" with the BBC about the company's commitments to human rights before the programme was aired, but said they were "clearly missing" from the broadcast.

The programme also alleged that employee payslips distributed by Pegatron disguised extra working hours as bonus payments, so it could not be known how many shifts each employee actually worked.

Countering this, Williams claims Apple tracked the weekly hours of one million workers in its Chinese supply chain, and that on average just 7% of employees exceeded the 60-hour workweek limit in 2014. Williams said this has fallen from more than 70 hours per week several years ago.

Relocating tin mining would be 'lazy and cowardly'

Despite admitting - as his company has publicly done in the past - that illegally mined tin may well end up in Apple's products, Williams said that switching suppliers away from Indonesia would be an easy but "lazy and cowardly" path to take, "because it would do nothing to improve the situation for Indonesian workers or the environment since Apple consumers a tiny fraction of the tin mined there.

"We chose the second path, which is to stay engaged and try to drive a collective solution."

The company hopes to introduced new systems to help separate legal and illegal tin, as have been implemented successfully in the Democratic Republic of the Congo. "We are looking to drive similar results in Indonesia, which is the right thing to do," Williams added.

Echoing what Apple has said before - and what it told Panorama - Williams said he "knows of no other company doing as much as Apple does to ensure fair and safe working conditions...and to provide transparency into the operations of our suppliers."

Addressing Apple's UK workforce, Williams said more than 1,400 Apple employees are stationed in China to manage its manufacturing operations and "are in factories constantly" to "speak up when they see safety risks or mistreatment."

Despite performing regular audits on working conditions, Apple provides work for more than one million people in China, and so can't reach a 100% pass rate with every one. "The reality is that we find violations in every audit we have ever performed, no matter how sophisticated the company we're auditing. We find problems, we drive improvement, and then we raise the bar."

Concluding, Williams said Apple is taking "all allegations seriously, and we investigate every claim. We know there are a lot of issues out there, and our work is never done. We will not rest until every person in our supply chain is treated with the respect and dignity they deserve."