iPhone best method to achieve device-to-device communication

后端 未结 3 1999
臣服心动
臣服心动 2021-02-06 20:02

What would be the best method to achieve realtime device to device communication within an application? I\'ve been experimenting with the Apple Push Notification Service but fi

相关标签:
3条回答
  • 2021-02-06 20:05

    Check out Apples GameKit framework GameKit Or a sockets based networking look at AsyncSocket which also includes an iPhone demo.

    0 讨论(0)
  • 2021-02-06 20:22

    If you are a beginner, use GameKit.

    When you get sick of that, use AsyncSocket.

    GameKit is so simple a child can use it; AsyncSocket is probably the most beautiful library in all of networking on any platforms - incredibly easy to use.

    In both cases, you will first use Bonjour (two lines of code) to "find" the other device.

    Here is the full explanation... Tablet(iPad/Android)-Server Communication Protocol

    Critical secret knowledge about GK you will need...
    Client/Server GKSessions

    Another quick summary ...
    Most effective way to do networking on Mac/iPhone?

    For the record, APNS has absolutely nothing whatsoever to do with what you are trying to achieve! Utterly forget about APNS.

    WHAT IS THE RADIUS? -----------------------***

    Please note that BLUETOOTH ONLY WORKS over about twenty feet. (Ten meters.)

    Please note that for a local WiFi connection, you must both be connected to the same local WiFi hub. WiFi hubs have a range of perhaps 20 meters only, say one house and the next house only (depending on how thick the walls are).

    Please note that: IT IS NOT PHYSICALLY POSSIBLE TO CONNECT TWO COMPUTERS (OF ANY TYPE) OVER A COUPLE OF MILES.

    There is no such networking device. (You could perhaps build one using say "ham radio" but to be clear it would be a completely novel, new research project that would take a large company years to complete.)

    There is absolutely nothing that works like that - I'm sorry to tell you the bad news.

    The ONLY two possibilties are Bluetooth and WiFi, and they work only over about 20 and 30 feet respectively.

    So how do you connect two remote computers like that? The answer is, via the internet.

    The only way to do it is with an internet connection. There is no 'direct' connection possible with any existing technology.

    If you need to know more about how to connect two computers (say two iPhones) using the internet, you will probably have to ask a new question! You will be pleased to know it is very easy and will cause you little trouble.

    Note that both iPhones MUST have a good solid internet connection. If they are more than say 30 feet away from each other, the ONLY way to connect to iPhones is via the internet. THey must each have a good internet connection, or there is no possibility.

    I hope this helps clarify things!

    0 讨论(0)
  • 2021-02-06 20:28

    You can use GameKit's peer to peer services (bluetooth) Gamekit how to do p2p wifi connection in iphone

    0 讨论(0)
提交回复
热议问题