Reputation: 1169
I'm developing an app where you can remove ads an unlock some content with an upgrade with in-app billing.
My question is: how should I determine if the app is upgraded or not? It has to work offline, so after purchase state change the app has to know if it is upgraded. My idea is storing the main gmail account's address encrypted with sharedfreferences. This way the sharedpreferences file only works with one account, so people can't share it to get the paid content free. But using personal information like email adress requires risky premissions, so users may not download the app.
Is there any solution for this problem, which works offline and doesn't requires personal information?
Upvotes: 2
Views: 571
Reputation: 31048
My understanding of SharedPreferences was that any data stored by an app is private to that app. Using a putString()
for example, you could hash and store something when a user purchases the upgrade. The something could be a hash of their email address, the transaction ID, it doesn't really matter.
Then on startup, check for the existence of this key and depending on that result, either display or remove the ads.
Upvotes: 1