Facebook and Apple are in a fight. Your browsing history is in the middle.

Facebook on Thursday ran its second full-page newspaper advertisement in as many days, attacking Apple's plans to tell iPhone and iPad users when apps are tracking them online.

Apple CEO Tim Cook and Facebook CEO Mark Zuckerberg.Apple; NBC News

Apple and Facebook are going to need each other in the long run, because billions of people want their social media apps to work well on their phones and tablets. But first, the two California tech giants need to settle a brawl that’s playing out in newspaper ads, industry meetings and potentially federal court.

Facebook on Thursday ran its second full-page newspaper advertisement in as many days, attacking Apple's plans to tell iPhone and iPad users when apps are tracking them online.

“Apple plans to roll out a forced software update that will change the internet as we know it — for the worse,” Facebook said in the ad.

It’s a high-stakes and unusually personal fight between two companies that have wide-reaching influence. At the center of the battle is how the advertising-dependent part of the internet is going to work in the years ahead.

In the next few weeks, Apple is planning to roll out a new feature on its devices that will alert people when an app such as Facebook is trying to “track your activity across other companies’ apps and websites.” People will have options such as “Ask App not to Track” or “Allow.”

“Users should know when their data is being collected and shared across other apps and websites — and they should have the choice to allow that or not,” Apple said in a statement. “App Tracking Transparency in iOS 14 does not require Facebook to change its approach to tracking users and creating targeted advertising, it simply requires they give users a choice.”

For Facebook, the possibility that many people will disallow tracking threatens one of the data streams that make its advertising business so lucrative. Facebook uses data such as browsing history to show people ads they’re more likely to want to see, and to prove to marketers that its ads are working.

“Apple’s move isn’t about privacy, it’s about profit,” Facebook said in a statement. It argues that Apple stands to gain if more of the internet becomes subscription-based, because Apple collects commissions from its app store.

The two companies, headquartered a 15-minute drive apart, have been circling each other warily for years. Apple CEO Tim Cook has dinged Facebook for “collecting gobs of personal data,” while Facebook CEO Mark Zuckerberg has fired back by calling iPhones an expensive product for the world’s elite, not the masses. Facebook encourages its employees to use rival Android devices.

Last year, Apple caused temporary disarray at Facebook headquarters by shutting off Facebook employees’ access to internal Facebook corporate apps that run on iPhones. Apple had determined that Facebook improperly paid teenagers and others for their smartphone data.

The companies have radically different business models. Facebook last year made $70 billion from advertising, almost its only revenue source. Advertising sales are a small part of Apple’s $275 billion annual revenue, which comes mainly from device sales and app store commissions.

Apple has said the new tracking notifications will start to appear in early 2021. Privacy groups such as the Electronic Frontier Foundation support them.

But Facebook is making a last-ditch effort to persuade Apple to back off or compromise with industry standard-setters.With offline ads in newspapers such as The Washington Post and The Wall Street Journal, the social networking company is trying to rally to its side the millions of small businesses who buy ads on Facebook and Instagram.

The latest ad, on Thursday, argues that free online publishers won’t be able to survive if Apple has its way, unless the publishers charge subscriptions — which Apple may get a cut of, thanks to the rules in its app store.

“Take your favorite cooking sites or sports blogs. Most are free because they show advertisements,” Facebook said in its ad. “Apple’s change will limit their ability to run personalized ads. To make ends meet, many will have to start charging you subscription fees or adding more in-app purchases, making the internet much more expensive and reducing high-quality free content.”

Facebook has raised the prospect of antitrust legal action. It said in a blog post that it was committed to providing information to a federal court in an ongoing lawsuit against Apple filed by Epic Games, which is seeking to reduce the fees it pays through the Apple app store.

“We believe Apple is behaving anti-competitively by using their control of the App Store to benefit their bottom line at the expense of app developers and small businesses. We continue to explore ways to address this concern,” Facebook said.

Facebook is battling antitrust complaints from states and the Federal Trade Commission, and both Zuckerberg and Cook have been compared to “emperors.”

Apple, for now, is standing by its plans for tracking notifications and pointing to a long record of advocating for online privacy.

“We believe that this is a simple matter of standing up for our users,” Apple said.