File transfer from iOS App to Mac App?

2019-02-11 07:22发布

问题:

Is it possible to transfer files between a Mac app and a iOS app? I want to transfer files that are in the documents directory in my iOS App to my Mac App via Wifi, how could I do it?

回答1:

Well, as of iOS 5 onwards, there's iCloud. Since that's still under NDA, I'll just have to point to the relevant documentation and let you read up on your own.

If not, I'd consider using the fabulous Dropbox APIs. This does require your users signing up for a Dropbox account, but then you get automatic two-way syncing between their Mac (or PC) and their iOS devices.

Failing that, there's always Bonjour. Properly configured - and it's not super easy, there is a bit of CFSocket or BSD socket work that you need to do - Bonjour will discover any services on the local network, Mac or iOS.