(Reuters) — Apple 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.

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…