Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top