SAN FRANCISCO — You can expect to hear a lot more from Apple about the virtues of mobile apps and online services in coming months. And for good reason: They’re just about the only part of Apple’s business that’s growing right now.

Apps and services have always been key to the appeal of Apple products. But with iPhone sales down for the second quarter in a row – and speculation that a major redesign won’t arrive until late next year – Apple is talking up its online business, promoting it with new kinds of ads and even sponsoring an upcoming reality TV show called “Planet of the Apps.”

The giant tech company sold 40.4 million iPhones in the last quarter – 15 percent fewer than a year ago, according to its earnings report Tuesday. Analysts say consumers just aren’t as excited about the newest iPhone models. As a result, Apple’s overall revenue fell 15 percent to $42.4 billion for the three months ending June 30.

Apple also sold fewer iPad units, Mac computers and Apple Watches in the last quarter, although iPad revenue increased, thanks to the introduction of higher-priced iPad Pro models. And a modestly better forecast for the current quarter sent Apple shares up nearly 7 percent in late trading, after closing at $96.63.

But the biggest bright spot in the company’s report was a 19 percent sales jump for the segment that includes iTunes, Apple Music, the App Store and services like Apple Pay and iCloud storage. That segment produced nearly $6 billion in sales – more than Apple pulled in from quarterly sales of either iPads or Macs.

FOR SERVICES RENDERED

Apple makes money from online services by taking a percentage whenever users pay to download a song from iTunes, buy an app from the App Store or subscribe to a streaming service like Apple Music. It keeps 30 cents of every dollar spent in the App Store, for example, and passes 70 cents to the app developer. Apple also collects fees from people who buy extra iCloud storage and from banks when customers use their credit cards with Apple Pay.

Since growth is what Wall Street likes to see, Apple executives are increasingly touting the purchasing power of the company’s massive customer base – nearly 600 million owners of Apple devices who spend an average of $68 a year on apps, music and other services.

“We expect this business will continue to grow” even if Apple sells fewer devices in a particular quarter, Chief Financial Officer Luca Maestri told The Associated Press. “It’s becoming a very meaningful portion of what we do.”

Apple’s still optimistic about the iPhone, CEO Tim Cook assured analysts. But he also boasted that Apple’s online services will produce as much revenue as a Fortune 100 company by next year.

REALITY OR BUST

That’s where shows like “Planet of the Apps” come in. Apple is partnering on the project with a team of veteran Hollywood producers and musician/entrepreneur will.i.am.

Though it’s expected to be something like a “Shark Tank” competition for app developers, Apple has kept a tight lid on details such as who will host or when it will air. But it will undoubtedly promote the App Store. It also demonstrates Apple’s desire to create original programming as a way of drawing more people to purchase music and videos on iTunes and Apple TV.

THE WAITING GAME

Most experts predict iPhone sales will pick up this fall, when Apple is expected to release new models. But some analysts are warning of tepid sales even then, citing industry rumors that Apple may wait until 2017, the tenth anniversary of the iPhone’s release, before making dramatic improvements to its signature smartphone.

Apple is also confronting a slump in demand for its newest gadget, a smartwatch introduced last year. While it doesn’t break out sales figures for the Apple Watch, the company said revenue in its “Other Products” segment, which includes the watch, fell 16 percent in the quarter.