GDPRDialog Save

GDPR fragment dialog implementation

Project README

DEPRECATED (REPLACED BY A NEW LIBRARY)

This library is deprecated in favour of my MaterialDialogs library - it's a very modularised library so switching to it won't add a lot of unnecessary overload if you don't want it.

Switching is easy, because I've based the GDPR Dialog module completely on this library, so after switching to new library the new library will reuse the settings from this library automatically (it will reuse any already given consent)

Read the readme(s) over there if you want a full insight, but here's a short example how it works after switching:

Side Note:

  • after switching, you do not need to implement any interface in an activity anymore - the dialogs use a more convenient alternative solution.
  • the other dialog uses material 3 theme
  • all the benefits of the other dialog library which can be found inside its readme

Usage:

1) create a setup

// nearly a kotlin based copy of the GDPRSetup from this library
val setup = GDPRSetup(
    networks = listOf(GDPRDefinitions.ADMOB),
    policyLink = "https://www.policy.com",
    //explicitAgeConfirmation = true,
    //hasPaidVersion = true,
    //allowNoConsent = true,
    explicitNonPersonalisedConfirmation = true
    // ...
)
val shouldAskForConsent = GDPR.shouldAskForConsent(activity, setup)
if (shouldAskForConsent) {
    DialogGDPR(
    	1100, // some id for identification
    	setup = setup
    )
        .showDialogFragment(activity)
}

3) handle the dialog result

The ID parameter is optional, you can listen to ALL events of a specific type as well, but check out the other library for more details.

// handle ALL events
onMaterialDialogEvent<DialogGDPR.Event>(id = 1100) { event ->
    // handle the event including cancels...
}
// handle specific state event only
onMaterialDialogEvent<DialogGDPR.Event.Result>(id = 1100) { event ->
    // handle successful events only...
	val state = event.consent
}
val currentConsent = GDPR.getCurrentConsentState(this, setup)
val canCollectPersonalInformation = GDPR.canCollectPersonalInformation(this, setup)

README

Check out the old readme of this repository here: README

Open Source Agenda is not affiliated with "GDPRDialog" Project. README Source: MFlisar/GDPRDialog
Stars
211
Open Issues
3
Last Commit
1 year ago
Repository
License
Tags

Open Source Agenda Badge

Open Source Agenda Rating