The world's largest fast-food chain had employees up at the crack of dawn on Friday morning, passing out McDonald's apple slices and, yes, McDonald's baked apple pies, to tired and hungry customers who had waited hours in long lines outside Apple stores in New York and Chicago for the widely anticipated release of the iPhone 6 and iPhone 6 Plus.

The promotions generally ended about the time the stores opened around 8 a.m. local time

Call it piggyback PR. Sure some other, smaller companies also were out there trying to bask in Apple's PR glow, too, but not many other multibillion-dollar brands. But McDonald's isn't just in it for some rub-off publicity around the new iPhones. It's got another legitimate reason: more business.

McDonald's was one of the first retailers, along with Whole Foods and Panera Bread, to agree to accept Apple Pay -- the new mobile payment system that works with the new iPhones and Apple Watch. It works by customers keeping a finger on the iPhones 6's Touch ID and holding their devices near a special reader to pay for a meal inside at counters or at drive-thrus.

Even then, it was a PR bonanza for McDonald's early Friday. "It was just a lot of fun to interact with the crowd," says McDonald's spokeswoman Rebecca Hary, who was helping to pass out apple pies to folks who had spent the night in line. "They'd been waiting in line so long, they were sure glad to see us."

All morning, McDonald's publicists also tweeted out photos with punchy captions of line-waiters eagerly embracing the freebie food. A photo of consumers happily holding up their McDonald's apple pies came along with the caption,"You know what they say, smile with your pies."

For McDonald's, whose same-store sales have been heading south and which hasn't had a lot of positive PR lately, the move was brilliant, one public relations expert said.

"Sure, it's unusual for one multibillion-dollar conglomerate to piggy-back on another brand," says Ronn Torossian, CEO of 5W Public Relations. "But what other brand besides Apple can get people sleeping in the streets in cities throughout the world?"

For several hours, until the stores opened, McDonald's employees also passed out other souvenirs, including sunglasses and T-shirts, "to build excitement about Apple Pay soon being available at our restaurants," Hary says. The new service will begin in mid-October.

In the meantime, Torossian says, other marketers need to pay closer attention. "If I was Burger King, I'd take on McDonald's in the street right now."SOS