1

I have an app (a game) which stores data (high scores, etc.) in the Documents directory (gotten by specifying NSDocumentDirectory to NSSearchPathForDirectoriesInDomains).

Now I want to release a free version of my app. I want both apps to be able to access the same files (for example: a user of the free app gets some high scores, then upgrades to the paid app - the high scores saved by the free version should be loaded into the paid app). Because the apps have different app id's (is that even the right thing to do with separate free/paid versions?), they'll have different save locations, yes?

So I guess the first question is, is having separate app id's for free and paid versions of the same app the right thing to do? If so, the second question is, how can I share files between them?

zpasternack
  • 17,838
  • 2
  • 63
  • 81

3 Answers3

2

If your apps both have the same identifier (a wildcard identifier) they can share some data. As far as I know it's limited to using the keychain, so not much use for you.

Apps can't read other apps Documents folder, so your other options are to register a custom URL scheme and use a "Send High Scores To Paid Version" in the Lite version. Or you can use a server with login (or one of the social gaming frameworks).

Your best bet is probably to have one app with an upgrade provided by in-app purchases. It saves a lot of messing.

Here's a few refs:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/13813-can-lite-paid-apps-share-user-data.html
How to share custom data between iPhone applications?

Community
  • 1
  • 1
nevan king
  • 112,709
  • 45
  • 203
  • 241
0

Have the app upload the high scores to a server somewhere, saved along with some login information or the device's UUID, then redownload it later.

sipefree
  • 191
  • 4
0

Use

Context otherAppCtx= ctx.createPackageContext("package of the app from retrieve data");

then on otherAppCtx you can load any resource.

Jason
  • 2,503
  • 3
  • 38
  • 46
Robin Hood
  • 1
  • 1
  • 1