MFlisar / GDPRDialog

GDPR fragment dialog implementation
Apache License 2.0
211 stars 53 forks source link

Check if user is in EEA on every launch. #79

Open robigangsta opened 5 years ago

robigangsta commented 5 years ago

I noticed an issue with library, here is the problem: When user for example downloads app via VPN, the dialog wont show(eg. vpn country is Canada), next time user runs application, he doesn't have VPN enabled anymore, the dialog for consent wont show because on initial launch user is declared as NOT_IN_EAA, when in fact he is. Therefore a problem.

Same thing happens when let's say if user is on a trip out of EEA and returns.

Is it possible to request location check on demand, and not just once?

MFlisar commented 5 years ago

Just call GDPR.resetConsent() in your application to reset the state in every app start. Or whenever you want the library to forget about any known consent state

Afterwards the library will think it needs to recheck for consent automatically... currently there is no other solution for this

One thing you can do is to check the current consent state on app start yourself - you'll get a GDPRConsentState object which also contains the location which you can use to decide if you want to reset the known consent state or not...

I would appreciate a pull request with the desired changes (I'd suggest a flag like invalidateCachedStateOnLocationChange or similar in the setup builder to enable or disable this behaviour).

I personally don't use the location checks at all and simply ask everyone for consent no matter where they are from...

robigangsta commented 5 years ago

Actually GDPR.resetConsent() might just do the trick, consent state can be saved in custom SharedPreferencesfor a double check, for example, usingGDPR.resetConsent()on every launch to check if location has changed for example from UNDEFINEDto IN_EEA, and if yes, request new consent, if not proceed as usual.

But yeah the flag solution is much better.

Also, if I were regular ignorant 20 IQ user in for example US or India, I wouldn't want to see some dialog for my data. Especially if it's only 1 in 10000 apps showing it. It's a double edged sword, some users will appreciate it, some will think you are stealing their groceries lists. Also seems like a bad idea for revenue. But that's just my view on it.