Question

I have gone through following link

http://zachwaugh.com/2009/03/programmatically-retrieving-ip-address-of-iphone/

and I have also tried this one (but this isn't recognized by Apple).

http://appsamuck.com/day4.html

I just want that when user tap on "wifi" button.

Reports stored in documents directory can be accessed by other pc using wifi using the IP that I display on my iPhone application. How is it possible?

Was it helpful?

Solution

In my apps, I use CocoaHTTPServer to get local info into and off of the phone. You run the server and out-of-the-box, it indexes all the files in the documents directory.

To do what you want, you will need to edit the code to return some other kind of data format (xml probably is the easiest) the call this from inside your app to get that data. CocoaHTTPServer easily take POST right out of the box too, so you can post an xml response as well.

After thinking about it, CocoaHTTPServer is best run on the computer side behind the scenes. the iphone can then send info to the computer where handling the code should be easier and you have more options.

OTHER TIPS

I can't point to any specific examples but the way to do this would be the ZeroConf protocol - both the iPhone and PC would have to be on the same network to have this work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top