Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consents remain when restarting app #18

Open
OrWestSide opened this issue Dec 16, 2019 · 2 comments
Open

Consents remain when restarting app #18

OrWestSide opened this issue Dec 16, 2019 · 2 comments

Comments

@OrWestSide
Copy link

When I install the app for the first time, the consents are not given. If I give them, then the Constants.KEY_CONSENT_CHANGED is fired.

But when I restart the app, and I want to give consent for another user, the consents are not reset, they are on, meaning that the Constants.KEY_CONSENT_CHANGED is not fired.

Is there any way to reset the consent fields? Or I have to check manually if every consent is given?

@DavidEdwards
Copy link
Owner

I don't think so, it should be trivial to add a reset function though. You could delete all or specific consent by editing the preferences:

val prefs = context.getSharedPreferences(Constants.PREF_GDPR, Context.MODE_PRIVATE)

@OrWestSide
Copy link
Author

Thank you for answering. I tried 2 approaches. The first one is this:

for (int i = 0 ; i < gdpr_list.size() ; i++){
    gdpr_list.get(i).setConsented(false);
    gdpr_list.get(i).setSeen(false);
}

but the consents are not reset.
I tried using the shared preferences as you mentioned, by doing this:
context.getSharedPreferences(Constants.PREF_GDPR, Context.MODE_PRIVATE).edit().commit();
I also tried with .apply() but still not any luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants