How to store information in iPhone so that it cannot be removed when application removed. For example to indicate if user already used all trial features. I tried to use [NSUserDefaults standardUserDefaults] - but it refreshed each time app deleted.
-
1If you have trial features, you're doing it wrong. Instead offer a free copy of the app and use in-app purchases to unlock your "pro" functionality. – bpapa Mar 01 '10 at 21:43
-
Also, any use- or time-limiting trial will be rejected by App Store reviewers. – Brad Larson Mar 02 '10 at 00:06
4 Answers
Apple doesn't allow you to do this. If Apps could leave files after they are uninstalled then you could have your disk fill up with no way to actually get rid of the stuff.

- 178,991
- 47
- 309
- 337
Some applications handle this by retrieving the device's unique identifier (UDID) and storing it one their servers. If the server sees the same UDID twice from the application's validation step, deny validation.

- 59,888
- 27
- 145
- 179
-
I don't think this would fly with the App Store reviewers, though. – Can Berk Güder Mar 01 '10 at 19:46
I think it’s possible to store such data in the keychain, see this forum. I also think it’s evil to do such a thing, as you are fighting the user, but it’s your choice.

- 102,279
- 44
- 260
- 354
Your best bet here is probably to store data to a server, associating the device UDID with whatever information you want to store. To get the UDID, do this:
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
If you don't want to setup a server yourself, you can use this handy service I've been trying out called Parse: http://www.parse.com/ You'll be able to use their native SDKs to store data to their cloud service, and then retrieve it. You should be able to simply store the udid with one of their objects, and then retrieve it again with a query.

- 480
- 4
- 11