Apple has yanked an app called HKmap.live from its app store just days after approving it. The app used crowdsourcing to track the location of protestors and police officers in real time. The app's anonymous author says it's intended to help people in Hong Kong stay safe by avoiding potentially dangerous areas.

Apple's latest move came after China's official state-run newspaper, the People's Daily, criticized the app for aiding anti-government protestors—labeled "rioters" by the government—and endangering public safety.

Apple first rejected the app in early October, arguing that it "allowed users to evade law enforcement." Critics pointed out that Apple has approved other apps with similar functionality, including the speed-trap warnings on Waze.

Then on Friday Apple reversed itself and approved the app. That, in turn, attracted criticism from the Chinese government and its allies—including officials in Hong Kong. So on Wednesday Apple reversed itself a second time and removed the app from its app store.

The app's developer insists that HKmap.live is designed to help everyone stay safe and isn't specifically designed for protestors. But it has obvious value for people participating in Hong Kong's pro-democracy demonstrations by helping them find one another and avoid unwanted interactions with law enforcement.

In a Wednesday statement, Apple said that it had heard concerns about the app from many Hong Kong customers.

"The app displays police locations, and we have verified with the Hong Kong Cybersecurity and Technology Crime Bureau that the app has been used to target and ambush police [and] threaten public safety, and criminals have used it to victimize residents in areas where they know there is no law enforcement," Apple said in its statement.

Apple has powerful financial incentives to appease the Chinese government. Most of Apple's manufacturing occurs in China, and China is also a big market for Apple's products. In recent quarters, China has accounted for more than 15% of Apple's global sales.

Last month, Apple released a new version of iOS, 13.1.1, which removed Taiwan's national flag from the emoji keyboard for users in Hong Kong. Taiwan has enjoyed de facto autonomy from the mainland for 70 years, but the Chinese government still considers it a rogue province. Apple also recently banned the app for business-news site Quartz from its Chinese app store because the app "includes content that is illegal in China."

Apple CEO Tim Cook has defended moves like this in the past, arguing that Apple has an obligation to follow the law in each jurisdiction where it operates.

Other companies have caved to Chinese pressure

In recent weeks, a number of high-profile American companies have engaged in censorship at the behest of the Chinese government. Earlier this week, we reported that Blizzard banned a Hong Kong Hearthstone player from its professional tournaments and stripped him of his prize money after he shouted a pro-Hong Kong slogan during a livestream.

Meanwhile, the National Basketball Association has continued to censor speech critical of the Chinese government. The NBA's China headache began when Rockets General Manager Daryl Morey tweeted in support of Hong Kong's protestors. The Chinese government responded harshly, suspending broadcasts of some NBA games. The Rockets lost some Chinese endorsement deals.

Since then, the NBA has paid lip service to free speech while continuing to censor criticism of the Chinese government. Fans in Philadelphia and Washington, DC, have been ejected from NBA games for holding up signs supporting Hong Kong and drawing attention to the Chinese government's treatment of its Uighur minority.

When CNN's Christina MacFarlane asked Rockets stars James Harden and Russell Westbrook if recent events would discourage them from speaking out on political topics in the future, the question was quickly shut down by an NBA official who insisted that the players would only answer questions related to basketball.