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.
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?
- Open Wifi Settings by “prefs:root=WIFI” failed in iOS 10
- How does the iPhone learn new WiFi locations in terms of using them for location estimates
- iOS - Geofencing with WiFi turned off
- List / Scan for available WiFis iPhone
- How to switch between wi-fi networks at runtime(programatically) in iPhone app
- ipad to ipad file transfer via wifi
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.
Here is an excellent tutorial to get started, its for iOS but CFNetwork is available in OS X too.
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.
- Core Data not firing fault for an NSManagedObject instance as property on app delegate
- How to set iPhone UIView z index?
- How to set exit code value for a command line utility in Swift?
- repeat playing automatically
- What is the Life Cycle of an iPhone application?
- Right Way for changing timeoutIntervalForRequest in Alamofire
- How to rename react-native entry file (index.ios.js)
- Picking a Random Object in an NSArray
- UICollectionView: One Row or Column
- Xcode 7 does not build project with c++ framework
- streamReader for server URLs
- Converting custom class object into NSData
- Developing universal in Xcode 6
- How to detect a swipe event in a UITableViewCell with a UISwipeGestureRecognizer
- Xcode Service: Select Git Branch