Apple plans to invest CNY3.5 billion ($507 million) in R&D in China and set up additional research hubs in Shanghai and Suzhou, after already committing to build facilities in Beijing and Shenzhen.

In a statement Apple said its growing engineering and operations team in China will focus on working with more local partners to develop advanced technology and services for customers in China and around the world.

“We are looking forward to working with more local partners and academic institutions through the expansion of R&D centers in China,” said Dan Riccio, SVP of hardware engineering at Apple.

The US headquartered company said it expects to open all four research centres later this year.

In October Apple announced plans to set up a second R&D centre in the southern electronics manufacturing hub of Shenzhen as it moves to strengthen its relationship with partners including Foxconn. Apple said last August it was building its first R&D centre in China in Beijing.

The iPhone maker encountered a number of challenges in China, its second largest market, where demand for iPhones dropped sharply and it faced a series of legal and regulatory hurdles which continue to weaken its competitive position.

In Q4 Apple saw its market share in the mainland fall by 4 percentage points to 11 per cent after shipments dropped 13 per cent to 14.9 million units, according to IDC. Last year was the first time Apple suffered a year-on-year decline in the China market, with shipments down 23 per cent and its share falling 4 points to 9.6 per cent during 2016.