My attempt to take didomi's mobile challenge https://github.com/didomi/challenges/tree/master/mobile
The library is implemented in didomi-consent
module and the sample in app
You need to initialize the library with the application context before using it. Somewhere in your main
import com.example.didomiconsent.Consent
Consent.initialize(applicationContext)
After that, you will be able to:
- get the current consent status
Consent.getConsentStatus()
- collect the consent in an activity using the provided dialog
Consent.collectConsent(activty) { status -> //... }
- observe any consent status changes by subscribing a listener
Consent.setStatusListener { status -> //... }
- reset the stored status
Consent.resetConsentStatus()