views:

84

answers:

4

I want to send some Text plus a image from one iphone application to other iphone app but restriction is I should not use a web server in between communication,Is there any way to fulfill it ? Details: There are two independent devices and could be far enough say out of network. My requirement one app adds some text with a image and sends it to another iphone which can be at any long distance , and the app installed in another iphone will read that info and image into itself.

+3  A: 

There is far from enough information to provide a specific answer.

  • two apps on two different devices?
  • are the two devices on the same network?
  • are the two devices both on WiFi?
  • do you need the user to receive a notification or something if the app isn't running?

If on same device, you can define a custom URL handler in the destination app and then openURL: in the source app to pass the data over. Encode your image and text into the URL, but be careful of size limitations.

If on different devices, there are many possible solutions, but answering the above questions will be critical to actually knowing what solution is appropriate.


Given your comment -- two apps, different devices, arbitrary networks -- then you are going to have to have some kind of server in between. Note that the recently added Game Center does have the ability to rendezvous two users, but it has a very particular user experience that may not be appropriate to your needs.

I would suggest that you investigate using push notifications to notify the receiving user of the availability of content. As for moving the content between, no direct connection is possible and you will have to have some kind of store-and-forward server in between. And, yes, a web server is going to be the easiest possible solution simply because HTTP is ubiquitous these days.

bbum
There are two independent devices and could be far enough say out of network. My requirement one app adds some text with a image and sends it to another iphone which can be at any long distance , and the app installed in another iphone will read that info and image into itself.
LondonDreams
LondonDreams, I don't think you have a choice really. If your devices are out of bluetooth range you are inevitably going to be using HTTP. The easiest route to go down would probably be a simple Restlike web service!
Jamie Chapman
+2  A: 

If there's no network of any kind available, but both parties have amateur radio licenses, then hooking the two devices up to HF packet radios might work.

hotpaw2
+2  A: 

THIS is super EASY.

  1. I would code up some software that can turn data into modem signal, like the good old dial up modem. The device would actually make those annoying buzzing sounds.
  2. You get the phone number for your friends nearest landline and call him.
  3. He places his iPhone near the phones receiver in listen mode and you connect to his phone using your audible modem.
  4. Bingo, via the power of sounds you have sent data which is decoded on his device and all for the very cheap price of a phone call, there are pretty cheap these days especially if you use Skype.
John Ballinger
+2  A: 

Actually there is a solution that meets your needs — and that fits to bbums answer:

Create a HTTP-Server on the iPhone, using cocoahttpserver. than you will ask some webservice like whatismyip.com for your public ip. with this your iPhone can be connected worldwide.
But very likely ur wifi-network is not forwarding your port to the iPhone. Ash.
And even if: Now it gets difficult. How to publish your ip from one phone to the other? hmmm... — I got it: I will exchange the information in a centralized space! In the web!
... wait — that would be a Webserver.

You see: Without any kind of server in the Web the users would need to exchange ip manually and have full admin power and knowledge about the local network.
So IMHO bbums answer is the only way to go.


PS: I am working with http server running on iPhones. In local network that works great, especially with bonjour. And you can use them over distance network — but only with reconfiguration of your router — something you shouldn't force your user to do

vikingosegundo