Reputation: 727
I have an app that I want to make available for free - but only for a period of time ( trial period ). After this period has elapsed, user only have limited access to the app.
As I understand it, the cleanest way would be to implement a back end which stores the user installation details (that way if user install & reinstall, this info will still persist somewhere). But I also come across the concept of keychain, which seems to allow me to store arbitrary data in Apple's hosted server. So I am thinking to use this mechanism - to store the installation date for the user.
My questions : 1. Does this violate the intention of keychain ? 2. Can the user delete the keychain entry manually ? I think I read somewhere that user can reset their phone to delete entries.
Thanks in advance !
Regards
Alex
Upvotes: 2
Views: 353
Reputation: 998
You're pretty much right. You can store data in the keychain and it will remain even if user deletes your app and reinstalls it. The user can delete the keychain resetting their phone or restore from an backup taken before your app was installed, but virtually no user would be bothered to do this just to avoid paying for your app.
The keychain is designed for storing credentials securely, but you shouldn't encounter any issues using it to store a installation date. Note the keychain is local to the device but can be synced to other devices
If you implemented the backend solution, you'd still probably use the devices keychain to store a UUID (or other id) to recognise the device/user. More effort and probably no gain
Upvotes: 1
Reputation: 512
Not answering your main question, but I think you'll find that your first idea of a backend which tracks the install won't work, as Apple are hugely against apps being able to send any info that uniquely identifies the device.
As for the keychain, I'm fairly sure that while you could quite probably store enough data in there for your purposes, uninstalling the app will also wipe it's data from the keychain. You could possibly use iCloud to store what you need, but if the user realised that's what was happening, they could always delete your app's data from iCloud. I'd probably still go that route though.
Upvotes: 2