How do 2 iPhones exchange data?

I want to know how 2 iPhones can exchange data. I m coding in swift and need some examples for a simple app development. I have explored APNS and do not want to go that route of provisioning provider service/server. I found some GameKit examples but not sure if that would be something I can really use as my app is not really a game. I need my communication to go over internet. Not use Wifi/Bluetooth. Any other options? Please advise.
Re: iPhone to iPhone communication

Have you explored the resources available through Apple's Developer Center?
Re: iPhone to iPhone communication

Apple has a Developers forum in case you're interested. You'll get all your answers there.
Re: iPhone to iPhone communication

There's a Developers Lounge in iMore under iOS and OS X Development

Original thread: https://forums.imore.com/threads/how-do-2-iphones-exchange-data.322269/