BEIJING (Reuters) - Apple Inc AAPL.O is speaking with Chinese telecom firms to find ways to reduce spam received through its messaging service, a spokeswoman said, days after state media alleged it was allowing illegal content on its platform.

FILE PHOTO: A man looks at the screen of his mobile phone in front of an Apple logo outside its store in Shanghai, China on July 30, 2017. REUTERS/Aly Song/File Photo

The iPhone maker has been targeted by China’s state media through the past week and the official state broadcaster railed against it in a 30-minute special report on Tuesday, saying Apple allowed illegal content such as gambling apps.

“We are in touch with domestic telco companies to see what additional steps could be taken to reduce this inconvenience,” an Apple spokeswoman told Reuters on Thursday. It had on Wednesday declined to comment on the reports.

State-owned China News Service reported earlier that Apple was in contact with Chinese telecom companies among other measures it was taking to reduce junk messages.

“We are currently working on additional ways to further reduce it, including more advanced machine learning models to identify it and more tools to block fraudulent accounts,” the Apple spokeswoman said.

Greater China is Apple’s second-largest market and it said earlier this week that revenue in the country jumped 19 percent in the June quarter on strong iPhone X sales, showing investors it still had game even as cheaper Chinese rivals gain ground.

Beijing has criticized Apple before but the fresh attacks come as Chinese regulators have launched a new campaign to clean up spam and unsolicited calls, which are a pervasive issue in China where phone numbers are often sold on black markets.

The criticism highlights an increasingly fraught balancing act for the firm in the world’s biggest smartphone market at a time of mounting trade tensions between China and the United States. Both countries have imposed tariffs on exported goods and are fighting over patents and technology.

While China is limited in its ability to match tariff for tariff, it has stepped up scrutiny of business dealings involving U.S. firms including Facebook Inc FB.O and recently scuppered a deal between U.S. chipmakers Qualcomm Inc QCOM.O and NXP Semiconductors NXPI.O.

Alphabet Inc's GOOGL.O Google, which quit China's search engine market in 2010, will block some websites and search terms from the version of its search engine that it plans to launch in China, two sources have told Reuters.