ManagedConsent

/**
 * Will present a dialog for the users to grant or withhold their consent.
 *
 * @param cmp      Instance of [CMP] to be used.
 * @param context  The [Context] of your application.
 * @param delegate The [ManagedConsentDelegate] instance. Must not be null.
 */
class ManagedConsent(cmp: CMP, context: Context, delegate: ManagedConsentDelegate) : ConsentImplementation() {
    
    /**
     * Presents the consent screen ONLY if it is required by the used CMP (i.e. no user consent has been set yet).
     *
     * @param activity The Activity from which the consent screen will be shown.
     */
    fun showIfNeeded(activity: Activity)
    
     /**
     * Presents the consent screen if it is required by the used CMP (i.e. no user consent has been set yet) or the user has rejected the consent.
     *
     * @param daysAgo Minimum number of days that should be passed before re-showing the CMP
     * @param activity The Activity from which the consent screen will be shown.
     */
    fun showIfNeededOrRejected(daysAgo: Int, activity: Activity) {

    /**
     * Presents the consent screen, allowing the user to change consent settings.
     *
     * @param activity The Activity from which the consent screen will be shown.
     */
    fun editConsent(activity: Activity)

    /**
     * Tells the CMP to reload. You can call this method for example after receiving [ManagedConsentDelegate.managedConsentCMPFailedToLoad] callback.
     *
     * @param activity The Activity instance.
     */
    fun reload(activity: Activity)
}

Last updated