What could be the possible solution to this?
Yes, presuming you have your app running on all devices.
There are two parts to this:
On the service discovery front, I recommend that you use Bonjour for this. It’s a marketing term for various standard protocols [1] that are supported by all major platforms.
On Apple platforms, you can access Bonjour using many different APIs but we generally recommend Network framework.
On the communication front, you need to decide on an on-the-wire protocol that suites your needs. As to what that should be, it’s hard to offer a concrete recommendation without knowing more about the data you need to transfer.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Namely:
- RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses
- RFC 6763 DNS-Based Service Discovery