Apple’s online ebook-buying platform, the iTunes Store, is still the No. 1 digital platform, according to new data from Nielsen, according with the data released Tuesday.

Apple’s overall digital sales rose 8 percent to $865 million in the third quarter, while Amazon’s sales rose 13 percent to just shy of $2.1 billion.

The report marks a big turnaround for the online retail giant that has struggled with a loss of sales to consumers and the broader economy since the iPhone and iPad were introduced in 2007.

Apple has struggled to gain traction in its online marketplace, as it struggles to retain customers and keep up with new features like video streaming and its ability to offer free 3D glasses.

Apple’s market share dipped slightly from a year ago, falling to 31 percent from 34 percent, and its revenue fell 6 percent to nearly $16 billion.

Apple posted a net loss of $7.9 billion in the quarter, and a loss per share of 28 cents, the lowest of any major tech company.

The company had been forecasting a profit of $13.6 billion.

Shares in Apple, which is the world’s largest software company, rose nearly 6 percent in midday trading Tuesday.