A battle of the tech titans is brewing after Facebook violated Apple’s developer rules by launching a research app that allowed it to snoop on users’ data.

Mark Zuckerberg’s firm secretly paid people up to $20 per month plus referral fees to install a Facebook Research VPN that harvests data from their phones. The app bypassed the typical security features on iOS and Android as it was sideloaded using Facebook’s enterprise certificate.

These two hate each other. There was Ali-Frazier. Now there’s nerd versus nerd.

Beta testing services shrouded Facebook’s involvement and it was then to mine sensitive smartphone data, in breach of Apple’s rules. The firm responded by revoking Facebook’s ability to run employee-only apps, plunging the social media giant’s campus into chaos.

It restored Facebook’s enterprise certificate the following day, but the enmity between Zuckerberg and Apple chief executive will not die down so quickly. “The heart of this is ego,” said Scott Galloway, who wrote a book called The Four about the dominance of Apple, Facebook, Google, and Amazon. “These two hate each other. There was Ali-Frazier. Now there’s nerd versus nerd.”

Cook presides over a $300 billion empire and he is responsible for 132,000 members of staff, so his job description is extremely broad. But he now seems intent on adding the role of Facebook’s chief privacy watchdog to his list of responsibilities.

The Apple chief executive calls privacy “a fundamental human right” and he has laid into both Facebook and Google for misuse of data in the past.

Facebook purchased data mining business Onavo in a $120 million deal back in 2014 and this is seen as a seminal moment for the firm. It became a vital tool for gathering business intelligence and it is credited with helping Facebook justify its $19 billion purchase of WhatsApp after it saw how popular the messaging service was becoming.

The beta testing services it used, such as Applause, made no mention of Facebook. It gave the firm insights into which apps it should copy, the sites that users visited, the purchases they made on Amazon and other sensitive data.

But a backlash came when security expert Will Strafach exposed how Onavo was reporting to Facebook, and Apple overhauled its developer policies to ban apps from collecting data about other unrelated apps. That should have been the death knell for Onavo, but Facebook seemingly re-skinned it as Project Atlas, sideloaded it and kept harvesting data, paying users aged 13-35 to take part.

Apple was furious to learn that Facebook had used sideloading – which is only supposed to be for internal testing among accredited companies enrolled in its developer program and not for public use – to circumvent its privacy rules. By cutting off all of Facebook’s employees, it forced the social network firm to negotiate with Apple in order to regain developer status.

It is interesting to see Apple using the power of its app store and iOS operating system to force Facebook and other tech firms to adhere to privacy rules. If they do not comply, they risk losing access to hundreds of millions of iPhone users.

A much more radical step would see Cook wipe all of Facebook’s apps, including WhatsApp and Instagram, from Apple devices until the firm could prove that it will respect users’ privacy. That would massively impact Facebook’s bottom line, and it could force Zuckerberg’s team to implement a stronger policy around respect of privacy.

Yet it could also backfire on Apple, as Facebook, WhatsApp, and Instagram are among the most popular apps on its phones. Users might decide to switch to rival Android producers, although that would be a slow process. It could also be viewed as an abuse of Apple’s power, as some would argue that regulators should be clamping down on Facebook instead of firms like Apple.

A cold war is certainly brewing between these two giants and it will be fascinating to see how it develops and who blinks first if tensions escalate.