How can I create a small Mac app that receives data over the WiFi network from an iOS app?

What I need is to have a simple screen in this Mac app that just prints a string as the iPhone is transmitting strings through the WiFi network.

This string is simply a string value from a slider being adjusted up and down by the user on the iPhone. The data will be sent to the Mac app and then the Mac app will receive this signal from the WiFi network and simply print the values.

  • iOS - How to programmatically connect to a WiFi network given the SSID and Password using a private/3rd party library
  • Open Wifi Settings by “prefs:root=WIFI” failed in iOS 10
  • How do I get the current access point's MAC address/BSSID?
  • Is it possible to get wifi signal strength in ios 9
  • iOS receive data from bluetooth and then send information to a database on another server through wi-fi
  • iOS / Too frequent rssi event from driver..?
  • This is a constant connection. I’m not trying to sync once. I’m trying to listen to the iPhone device from the Mac to see if the iPhone is sending any more strings as the user slides the UISlider up and down from the iPhone app.

    How can I create the client side? Do I need to use Bonjour or something?

    2 Solutions Collect From Internet About “How can I create a small Mac app that receives data over the WiFi network from an iOS app?”

    Use the CFNetwork framework, you can use bonjour for discovery and then handle a persistent connection through native sockets for passing data back and forth.

    http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Introduction/Introduction.html

    Here is an excellent tutorial to get started, its for iOS but CFNetwork is available in OS X too.

    http://mobileorchard.com/tutorial-networking-and-bonjour-on-ip

    In my answer to this question, I provide a link to a sample application that has a Mac component and an iPhone one. These components communicate between one another over a WiFi network, with changes in a label on one being reflected in the other. This is done using Bonjour discovery and the standard networking APIs.

    With simple modifications, this could be used to send the continuous updates you need for your particular case.