Now, Apple is moving aggressively to shut down Iranian apps. The crackdown here follows the company's recent removal of apps in China that allowed residents to evade censors and gain access to the global internet, and were deemed illegal by the Chinese government.
On Thursday, Apple removed Snapp, a ride-hailing app similar to Uber that is popular in Iran, from its app stores. That followed the removal in recent weeks of apps for food delivery, shopping and other services.
In a message to Iranian developers whose apps were affected by the ban, Apple said, "Under the U.S. sanctions regulations, the App Store cannot host, distribute or do business with apps or developers connected to certain U.S. embargoed countries."
More from The New York Times:
Facebook scrambles to police content amid rapid growth
Iranian Parliament, facing US sanctions, votes to raise military spending
Iran reaches deal with Renault despite new US sanctions
An Apple spokesman, Tom Neumayr, confirmed the message's authenticity. He declined further comment.
Mahdi Taghizadeh, a founder of DelionFoods, an online food delivery service, said his app was among those taken down.
"We work so hard, and have to fight all the time, and now this," he said in an interview. "No one with an iPhone can download any of the popular apps any more. Imagine if in the U.S. you wouldn't be able to get Uber on your phone."
Mr. Taghizadeh has protested the move online, starting a campaign on Twitter, #StopRemovingIranianApps, to press Apple to end the crackdown. (Although the Iranian government has blocked Twitter in the country, determined users find ways to reach it.)
Google, which allows Android developers to publish apps in Iran so long as they do not involve purchases, does not appear to have taken a similar action against Iranian apps in its Play store, and its formal Play guidelines allow apps to be distributed in the country.
In addition to blocking Twitter, the Iranian government has long blocked Facebook and Google's YouTube service.
When it comes to technology, American sanctions against Iran over its nuclear weapons program are complicated. The Obama administration eased restrictions on American tech companies that offered internet services in Iran as a way of encouraging a free flow of information, especially among younger Iranians.
The Trump administration has modified the overall sanctions, and President Trump signed a new sanctions bill into law this month. It is unclear whether the administration meant to impose new restrictions on technology companies.
European countries lifted all sanctions against Iran after the 2016 nuclear agreement was reached.
Apple told Iranian developers in February to remove any payment options in their apps to prevent Iranian money from entering the United States in violation of the sanctions. Iran had developed its own internal online payment system, shaparak, in response to the sanctions. After the Apple notice, almost all Iranian apps, including Snapp, switched to shaparak, cash and other methods of payment.
"The full removal of Iranian apps by Apple means our work will be much more complicated," said Mr. Taghizadeh. His company had started an online campaign to attract more customers, but has decided to halt those efforts for now. "What is the point when people can't download your app?"
Iran's new telecommunications minister, Mohammad Javad Azari Jahromi, complained on Twitter about Apple's decision to remove the apps and said he was planning to pursue the issue.
Mr. Azari Jahromi wrote in Persian that "11 percent of the cellphone market in Iran belongs to Apple." He added: "Respecting customer rights is a principle today that Apple hasn't abided by. We will legally pursue the omission of apps."
Mr. Azari Jahromi is Iran's youngest minister. He hinted last week that Twitter and YouTube might be unblocked in the country, but he also said the decision was not his to make.
Twitter declined to comment, and YouTube had no immediate comment on the minister's remarks.
Apple is not formally represented in Iran, because of the American trade restrictions. Samsung, one of its key competitors, opened a large sales center in the country in February.