4

How could a full version of my iOS app access / copy the database / settings from the free version ?

I'm thinking of providing a free version of my app and I can't see how people then buying the full version could get access to the data from my free version ?

Jules
  • 7,568
  • 14
  • 102
  • 186

3 Answers3

9

All apps are isolated on iOS. They are installed as different iOS system users. One user do not have permission to access another user's files. In the old times, one common approach to address this problem is to enable iTunes file sharing. And tell users to manually copy the files.

Your better bet is to use the freemium model to sell your app. Make the app free, and unlock extra features via in-app-purchase. This way, your files, documents, settings won't need transferring to the pro version. The app itself becomes pro after unlocking.

Here is the guide from Apple: https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction/Introduction.html (though not very intuitive).

The walkthrough here: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/ is very helpful.

Last but not least, be aware that in-app-purchase is crackable. So please read: How to detect "IAP crackers"? , Verifying In App Purchase Receipt from Client , and https://stackoverflow.com/questions/4715414/apple-in-app-purchase-verify-receipt , verify in app purchase , In App Purchase Receipt verification within app .

Note that you are supposed to setup a server to validate iap receipts. Though it's doable from within the app, it's not safe. As far as I can remember, you can test in-app-purchase through StoreKit in iOS simulator v5.0, that should be Xcode 4.2. Before that, it can only be tested on a device.

@Dominik Hadl mentioned you can use a server to sync the file. The operation is usually complicated. If you prefer this idea, you can choose to use custom url scheme to launch one app from another to ease the operation. See steps below:

  1. User press "Begin sync" in the free app to upload the file to your server
  2. Server return the ID of the file to the free app
  3. User press "Launch Pro App and Download my file", which leads to a custom url scheme to launch your Pro version (must be installed first), with the file ID
  4. Pro version use the file ID to download that file directly
Community
  • 1
  • 1
He Shiming
  • 5,710
  • 5
  • 38
  • 68
  • ...If you prefer the idea of file transfer via server... url scheme... How do you mean / what's the basic idea behind this ? – Jules Mar 18 '12 at 10:10
  • @Jules I've clarified the steps in the edited answer. The basic idea is to use custom url scheme to launch apps and simplify file transfer. – He Shiming Mar 18 '12 at 11:11
  • I've seen apps which use http to perform a backup, the app is in effect a http server and then a pc or a mac is used to upload or download a file. Could't the free and full version communicate over http ? Although, I guess one of the apps would have to be put into suspended state. Any suggestions about this ? – Jules Mar 18 '12 at 12:07
  • Well, sure your two apps can communicate over HTTP. But the problem is you can't run two programs simultaneously on one device. Thus, beside the server part, you'll need to let one app know what to upload and the other, what to download. That's why I suggested using custom url scheme for inter-app communication. – He Shiming Mar 18 '12 at 16:16
0

Since multiple apps can share the same iCloud container, I'd say that the best practice nowadays is to "simply" store the data in iCloud.

(I'm putting "simply" under quotes, because it is easy to put data in iCloud and take it out; but if you actually want to do syncing, you may need to do more than just "I'll load from iCloud and save to iCloud" in order to provide the best experience to the user.)

Ivan Vučica
  • 9,529
  • 9
  • 60
  • 111
0

I think the only way how you can do this is syncing the data with some server, registering the device and the syncing the data back to the full version.

Because all iOS apps are sandboxed, they can't access any other application data (unless you have jailbroken iOS).

Dominik Hadl
  • 3,609
  • 3
  • 24
  • 58