Apple CEO Tim Cook at the Worldwide Developers Conference in San Francisco on June 2. Robert Galbraith/Reuters Tim Cook is "deeply offended" by the BBC's allegations that Apple mistreats workers in its Chinese factories where the company's iPhones and iPads are assembled.

The BBC's "Panorama" program sent undercover reporters to Pegatron factories on the outskirts of Shanghai, where it says it has uncovered poor treatment of workers and a breach of standards on workers' hours.

In an email to about 5,000 staff members across the UK, Apple senior vice president of operations Jeff Williams said both he and the chief executive were "deeply offended by the suggestion that Apple would break a promise to the workers in our supply chain or mislead our customers in any way.

"Panorama's report implied that Apple isn't improving working conditions," he continued. "Let me tell you: nothing could be further from the truth."

Williams said Apple had shared "facts and perspective" on the company's commitments to human rights with the BBC in advance but that they were "clearly missing from their program."

The BBC report alleged that workers fell asleep during 12-hour shifts on the iPhone 6 production line and were made to work 18 days in a row after repeatedly being denied requests for a day off.

Williams countered that Apple had tracked the weekly hours of over one million workers within its supply chain and that its suppliers had achieved an average of 93% compliance with the 60-hour workweek limit this year.

"We can still do better. And we will."

Apple employs about 1,400 manufacturing workers in China, who Williams said were "talented engineers and managers who are also compassionate people, trained to speak up when they see safety risks or mistreatment."

"We know of no other company doing as much as Apple does to ensure fair and safe working conditions, to discover and investigate problems, to fix and follow through when issues arise, and to provide transparency into the operations of our suppliers," he said.

Panorama also claimed to find children working in dangerous conditions on the Indonesian island of Bangka, where it said tin from illegal mines could be entering Apple's supply chain.

A screen shot from the BBC documentary shows workers falling asleep on an assembly line because of exhaustion. BBC

"Apple has publicly stated that tin from Indonesia ends up in our products, and some of that tin likely comes from illegal mines," Williams countered.

"Tens of thousands of artisanal miners are selling tin through many middlemen to the smelters who supply to component suppliers who sell to the world. The government is not addressing the issue, and there is widespread corruption in the undeveloped supply chain. Our team visited the same parts of Indonesia visited by the BBC, and of course we are appalled by what’s going on there.

"Apple has two choices: We could make sure all of our suppliers buy tin from smelters outside of Indonesia, which would probably be the easiest thing for us to do and would certainly shield us from criticism. But it would be the lazy and cowardly path, because it would do nothing to improve the situation for Indonesian workers or the environment since Apple consumes 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 spearheaded the creation of an Indonesian Tin Working Group with other technology companies and was seeking to implement a system to hold tin smelters accountable, he added.

Williams, who has worked for the company since 1998, assured Apple's staff that the company was taking the allegations seriously and would investigate every claim made.

"We know there are a lot of issues out there, and our work is never done," he concluded. "We will not rest until every person in our supply chain is treated with the respect and dignity they deserve."

Pegatron said they were carefully investigating the BBC's claims and would take "all necessary actions."

Apple told the BBC it worked with suppliers to "prevent excessive overtime and that no other company is doing as much to ensure fair and safe working conditions."

Williams' letter to UK staff in full:

UK Team,

As you know, Apple is dedicated to the advancement of human rights and equality around the world. We are honest about the challenges we face and we work hard to make sure that people who make our products are treated with the dignity and respect they deserve.

Last night, the BBC’s Panorama program called those values into question. Like many of you, Tim and I were deeply offended by the suggestion that Apple would break a promise to the workers in our supply chain or mislead our customers in any way.

I’d like to give you facts and perspective, all of which we shared with the BBC in advance, but were clearly missing from their program.

Panorama showed some of the shocking conditions around tin mining in Indonesia. Apple has publicly stated that tin from Indonesia ends up in our products, and some of that tin likely comes from illegal mines. Here are the facts:

Tens of thousands of artisanal miners are selling tin through many middlemen to the smelters who supply to component suppliers who sell to the world. The government is not addressing the issue, and there is widespread corruption in the undeveloped supply chain. Our team visited the same parts of Indonesia visited by the BBC, and of course we are appalled by what’s going on there.

Apple has two choices: We could make sure all of our suppliers buy tin from smelters outside of Indonesia, which would probably be the easiest thing for us to do and would certainly shield us from criticism. But it would be the lazy and cowardly path, because it would do nothing to improve the situation for Indonesian workers or the environment since Apple consumes 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.

We spearheaded the creation of an Indonesian Tin Working Group with other technology companies. Apple is pushing to find and implement a system that holds smelters accountable so we can influence artisanal mining in Indonesia. It could be an approach such as “bagging and tagging” legally mined material, which has been successful over time in the Democratic Republic of the Congo. We are looking to drive similar results in Indonesia, which is the right thing to do.

Panorama also made claims about our commitment to working conditions in our factories. We know of no other company doing as much as Apple does to ensure fair and safe working conditions, to discover and investigate problems, to fix and follow through when issues arise, and to provide transparency into the operations of our suppliers.

I want you to know that more than 1400 of your Apple coworkers are stationed in China to manage our manufacturing operations. They are in the factories constantly — talented engineers and managers who are also compassionate people, trained to speak up when they see safety risks or mistreatment. We also have a team of experts dedicated solely to driving compliance with our Supplier Code of Conduct across our vast supply chain.

In 2014 alone, our Supplier Responsibility team completed 630 comprehensive, in-person audits deep into our supply chain. These audits include face-to-face interviews with workers, away from their managers, in their native language. Sometimes critics point to the discovery of problems as evidence that the process isn’t working. 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.

Panorama’s report implied that Apple isn’t improving working conditions. Let me tell you, nothing could be further from the truth. Here are just a few examples:

Several years ago, the vast majority of workers in our supply chain worked in excess of 60 hours, and 70+ hour workweeks were typical. After years of slow progress and industry excuses, Apple decided to attack the problem by tracking the weekly hours of over one million workers, driving corrective actions with our suppliers and publishing the results on our website monthly — something no other company had ever done. It takes substantial effort, and we have to weed out false reporting, but it's working. This year, our suppliers have achieved an average of 93% compliance with our 60-hour limit. We can still do better. And we will.

Our auditors were the first to identify and crack down on a ring of unscrupulous labor brokers who were holding workers’ passports and forcing them to pay exorbitant fees. To date, we have helped workers recoup $20 million in excessive payments like these.

We’ve gone far beyond auditing and corrective actions by creating educational programs for workers in the same facilities where they make our products. More than 750,000 people have taken advantage of these college-level courses and enrichment programs, and the feedback we get from students is inspiring.

I will not dive into every issue raised by Panorama in this note, but you can rest assured that we take 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.

If you’d like to learn more about our Supplier Responsibility program, I encourage you and our customers to visit our website at apple.com/supplier responsibility .

Thanks for your time and your support.

Jeff