To adhere to GDPR, the user needs to be able to turn off and on Facebook logging.
I've turned it off by default in AndroidManifest.xml following their documentation, and turn it on after consent is given:
ConsentManager.addListener { consented ->
FacebookSdk.setAutoInitEnabled(consented)
FacebookSdk.setAutoLogAppEventsEnabled(consented)
FacebookSdk.setAdvertiserIDCollectionEnabled(consented)
FacebookSdk.setLimitEventAndDataUsage(this, consented)
FacebookSdk.fullyInitialize()
}
The user is able to reject consent again, without restarting the app. So to turn Facebook SDK off again, is it correct to just call the same SDK functions again but with false instead?
I'm a bit doubtful because:
- FacebookSDK is already initialised, so does calling setAutoInitEnabled() make sense?
- Do I have to call
fullyInitialize()again every time? - After turning it off and on again without restarting the app, I only get 400s and 403s while sniffing network calls via Charles