1

Does Apple offer an API or Kit so that I can start my program on the Desktop and transfer files to/from the device (using the desktop program)? The device will have a similar program/sandbox available. I'm trying to avoid requiring the user to run iTunes, DiskAid, or similar program.

I found an earlier answer [1], but it stated to use cocoahttdserver. Shooting from the hip, a http server feels 'wrong' (in the Windows world, I have the Ce Rapi gear [2] to do the same).

Note that I only need to transfer to a single sandbox on the device - not an arbitrary sandbox. If needed, I have both Mac and iPhone developer accounts (for signing, sharing, and other sandbox nicities).

Jeff

[1] iPhone : Transfer of files from Mac/Pc to app

[2] http://msdn.microsoft.com/en-us/library/ms860198.aspx

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885

1 Answers1

3

Sorry, but your options are wireless network transfer or iTunes. Of the wireless network transfers systems, if you need to be able to transfer over the local network HTTP+Bonjour is the best route.

Advertise your service on your desktop computer using a custom service type and use searchForServicesOfType:inDomain: on iOS to match only those services.

Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
  • > Sorry, but your options are wireless network transfer or iTunes. OK - for wireless, the option opens a port on the device which increases attack surface. So this option is not desirable and has negative security implications. – jww Mar 22 '11 at 00:04
  • 1
    You can run the HTTP server on your desktop instead of the iPhone if you're worried about having a port open on the iPhone. This is what I'm suggesting in my answer, actually. Running the server on the iPhone *is* possible, but I haven't done it. – Steven Fisher Mar 22 '11 at 00:26
  • OK. So I move the security hole from the device to the desktop when using the HTTP server! How does one use iTunes? Is there an iTunes API and Framework? Or am I missing the point here? – jww Mar 23 '11 at 20:41
  • 2
    You set a key in your info.plist and the user can drag documents in and out of iTunes. The documents are put into the Documents directory in your sandbox. See here: http://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW20 – Steven Fisher Mar 24 '11 at 05:24
  • OK. Sorry to beat a dead horse - I just want to be clear. So there are no known APIs (or perhaps, no publicly available APIs) for developers to use to transfer files between their desktop and device components. When Apple states to use iTunes for file sharing, they are stating the user must use iTunes to drag/drop; they are *not* stating to use an 'iTunes API or Framework' to perform the transfer. Is this correct? – jww Mar 24 '11 at 16:27
  • > "...if you need to be able to transfer over the local network HTTP+Bonjour is the best route". Forgot to mention.... I did a quick-ad-dirty audit of Bonjour on Windows. The best I can tell, the service is insecure (Apple Security did not get back to me, nor did the company fix the issues in the most recent patches). I don't think its prudent to require a user to use the service :( – jww Mar 24 '11 at 16:50
  • 1
    No, I don't think there is anything. Typically, this is handled through a client-server architecture. Btw, when I said "Bonjour," I really meant mutlicast. I'm fairly sure you can pull this off without requiring the user install Bonjour on Windows; it's supposed to be Zero Configuration Networking, after all. Wouldn't be much good if it required a service. :) You might want to search here and see what people have said about it. – Steven Fisher Mar 24 '11 at 22:31
  • My iPhone forensics book tells me that iTunes uses the "Apple File Connection" protocol. The best I can tell, Apple does not document the protocol [1]. How does Apple stay off the Department of Justice's Anti-Trust radar? I seem to recall Microsoft suffering years of litigation and settlements for similar with repsect to Browsers. [1] http://www.google.com/search#sclient=psy&source=hp&q=%22apple+file+connection%22+site:apple.com – jww Mar 26 '11 at 01:36
  • Why would you need Apple's protocol? They don't block you from doing your own. Go ahead. The important bit is ZeroConf, which is well documented. – Steven Fisher Jun 18 '11 at 05:02