iPhone only server? - iphone

Is it possible to restrict access to a server so that only iPhone devices can use it? I have no experience in setting up servers or the like before. I am still very fresh to programming. Thanks.

Is this a web server you're talking about? If so, then normal web requests have a User-Agent string in the HTTP header. You can check this value to see if the request is coming from an iPhone. If it's not coming from an iphone, you can reject the request, or redirect the user to a page explaining that your website is only for iphones.

If you are developing the server and iphone software, you could use some form of simple encryption. A model like SSL may be too heavyweight, but it may be an option.

Related

iPhone app's traffic not sniffable

I've got quite a bit of experience using Charles to sniff out traffic being sent out on my iPhones. Almost every app that I choose to reverse engineer has been possible in large part to cURL and Charles. But, for some reason, this one app called Link seems to have a different way of communication with their server. I looked through my entire Chalres session and didn't see any relevant traffic from this app to an API endpoint. I don't have much experience actually making mobile apps, so perhaps there are other ways to process all of the requests that have to be generated upon using the app. But, how could all of the user's data be stored if no requests are being sent from the app to an external server somewhere?
Charles is an HTTP proxy, it is possible another protocol is being used. Possibly directly using TCP/IP connections.
Wireshark will show all packets in gory detail but you will probably not be able to see encrypted data decrypted without the key.
And the Wireshark UI is something to behold. ;-)
If the app runs on SSL you wouldn't be able to sniff any traffic either way. I design my apps that way at least. Could this be the case? Does it use port 443 instead of port 80?
Okay. Have a look at this post:
http://www.doubleencore.com/2013/03/ssl-pinning-for-increased-app-security/
SSL pinning might be the answer.

A Server for IPhone app to exchange location

I'm trying to connect app to server that receive data from iphones using the app and the server would also response back (Location data) kind of like find your friends but done automatically. I don't know what server should be used for iPhone apps. Also what language would be used to communicate with the server ?
Any help/direction/articules would be appreciated.
You can use any server, and any language, as long as it's listening to requests on the port your app specifies, and you've configured it properly.
For starters, here is a nice PHP / iOS tutorial to get you up and running, although I'm not saying your final implementation must be in PHP: http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app

How can I view the Live HTTP Headers sent/received by an iPhone App?

How can I view the Live HTTP Headers sent/received by an iPhone App (the iPhone connects to the internet via a local WiFi router)?
I'm thinking something similar to the Live HTTP Headers plugin for Firefox.
Here's a guide to doing this using Charles, a proxy application.
http://blog.mediarain.com/2009/08/iphone-http-connection-debugging/
Here is a free solution I just found and tried, and it worked beautifully to capture GET/POST requests (which is exactly what I needed):
http://blog.jerodsanto.net/2009/06/sniff-your-iphones-network-traffic/
Debookee can intercept the traffic of your iPhone and will show you all its HTTP headers in real time.
Disclaimer: I'm one of its developers

Prevent from specific app using internet connection

I have a client claims that my app can't connect to internet despite of he has WiFi connection and Safari application, for example, works fine. Is there any way to setup for specific app NOT to connect to the internet? I use in my app simple ASIHTTTPRequest library to make a connections. Maybe it influenced by jailbroken device? Regards!
No, there is no way to do this in via an iOS setting.
However I've had a problem like this with a client, where to Webservice the app connecting to was blocked by there firewall/proxy.
Later the black was lifted but all calls to the webservice where is cached by the proxy give really weird results.

iOS Device communication

I am keen to get some apps built that can communicate with other devices/ web etc. i have played around with FTP and can get so far. But what is the best way to do this? We don't have any Servers with databases etc, but do have a site that we are currently uploading and downloading files to.
can anyone suggest a good/ better way to get the device to send/ receive files?
thanks
sam
If it's HTTP communication you're wanting to do, the simplest and most powerful tool is ASIHTTPRequest.
HTTP is the protocol your web browser uses to talk to web servers. If you have a site you're storing and downloading files at, it's almost certainly HTTP you're talking to it.
For iOS device to device communication one can use Bump API.
EDIT: I don't know of a generic framework for device <-> server communications, but having built applications that use web services of other providers like Yelp, Yahoo, Google Maps, I would say the way to go for this is to have REST based web services which exchange data in JSON format.