BEIJING (Reuters) - Apple Inc AAPL.O Chief Executive Tim Cook plans to visit Beijing later this month to meet high-level government officials, at a time when it is facing some setbacks in its most important overseas market, a source familiar with the matter said.

Cook has frequently traveled to China since taking the helm of Apple five years ago, but his latest visit comes during a critical period.

From weakening smartphone sales to the loss of an iPhone trademark dispute and the suspension of some of its online entertainment services, the U.S. technology giant has been facing a flurry of problems in recent weeks in its second-largest market after the United States.

That has raised concerns over Apple’s growth momentum, as the company reported last week its first quarterly revenue drop in 13 years.

Last week, billionaire activist investor Carl Icahn said in an interview with cable television network CNBC that he had sold his entire stake in Apple, citing China’s economic slowdown and worries about whether the government could make it very difficult for Apple to conduct business.

During his China visit, Cook plans to meet senior government and Communist Party leaders - including officials in charge of propaganda, said the source, who declined to be named as the plan is not public yet.

Apple did not respond to Reuters’ requests for comments.

STRICT CURBS

In recent weeks, the company has wandered into the crosshairs of the government’s ongoing campaign to control Web content and ensure localization of data storage.

Apple’s online book and film services were shut in China last month, cutting off a potential source of income, following Beijing’s introduction of regulations in March imposing strict curbs on online publishing, particularly for foreign firms.

Under President Xi Jinping, China is also trying to shift away from its dependence on foreign technology, especially in critical sectors like banking and insurance. Foreign businesses have staunchly opposed new regulations that they say threaten to cut them out of such industries.

Harsh censorship also has shut down the online services of many foreign tech companies, sparking outcry from overseas governments and business groups.

The Chinese government could “come in and make it very difficult for Apple to sell there,” Icahn said in the interview with CNBC last week.

Apple CEO Tim Cook speaks about the Apple TV during an event at Apple headquarters in Cupertino, California March 21, 2016. REUTERS/Stephan Lam

Apple’s refusal to cooperate with the U.S. authorities to provide source code to help them crack open the iPhone that was linked to a mass shooting in San Bernardino also has raised skepticism among some Chinese officials.

In China, Apple has been asked by authorities in the last two years to hand over its source code but the company refused, according to Apple’s top lawyer.

Despite growing concerns over its China business - Apple reported its revenue from Greater China, which includes Hong Kong and Taiwan, dropped 26 percent last quarter - Cook has been optimistic.

“I see China as may not have the wind at our backs that we once did but it’s a lot more stable than what I think is the common view of it,” he said during the company’s earnings call last week. “We remain really optimistic on China.”