Package com.intentsoftware.addapptr
Class ManagedConsent
-
- All Implemented Interfaces:
-
com.intentsoftware.addapptr.Consent,com.intentsoftware.addapptr.consent.CMPDelegate
public final class ManagedConsent extends ConsentImplementation implements Consent, CMPDelegate
Will present a dialog for the users to grant or withhold their consent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceManagedConsent.ManagedConsentDelegateNotifies about the need to show the consent dialog.
public enumManagedConsent.ManagedConsentStatePossible states of consent given by the user.
public enumManagedConsent.ShowIfNeededSetting
-
Field Summary
Fields Modifier and Type Field Description private final StringdebugInfoprivate final BooleanconsentStateForReporting
-
Constructor Summary
Constructors Constructor Description ManagedConsent(CMP cmp, Context context, ManagedConsent.ManagedConsentDelegate delegate)Will present a dialog for the users to grant or withhold their consent. ManagedConsent(CMP cmp, Context context, ManagedConsent.ManagedConsentDelegate delegate, ManagedConsent.ShowIfNeededSetting showIfNeededSetting)
-
Method Summary
Modifier and Type Method Description final UnitshowIfNeeded(Activity activity)Presents the consent screen ONLY if it is required by the used CMP (i.e. final UnitshowIfNeededOrRejected(Integer daysAgo, Activity activity)Presents the consent screen if it is required by the used CMP (i.e. final UniteditConsent(Activity activity)Presents the consent screen, allowing the user to change consent settings. final Unitreload(Activity activity)Tells the CMP to reload. UnitonConsentUpdated(ManagedConsent.ManagedConsentState state)UnitonCMPFailedToShow(String error)UnitonCMPFailedToLoad(String error)UnitCMPNeedsUI()UnitdidShowCMP()StringtoString()-
Methods inherited from class com.intentsoftware.addapptr.internal.ConsentImplementation
getConsentStateForReporting -
Methods inherited from class com.intentsoftware.addapptr.Consent
setNoConsentNetworkStopSet -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ManagedConsent
ManagedConsent(CMP cmp, Context context, ManagedConsent.ManagedConsentDelegate delegate)
Will present a dialog for the users to grant or withhold their consent.- Parameters:
cmp- Instance of CMP to be used.context- The Context of your application.delegate- The ManagedConsentDelegate instance.
-
ManagedConsent
ManagedConsent(CMP cmp, Context context, ManagedConsent.ManagedConsentDelegate delegate, ManagedConsent.ShowIfNeededSetting showIfNeededSetting)
- Parameters:
cmp- Instance of CMP to be used.context- The Context of your application.delegate- The ManagedConsentDelegate instance.showIfNeededSetting- ShowIfNeededSetting setting how the showIfNeeded method should behave.
-
-
Method Detail
-
showIfNeeded
final Unit showIfNeeded(Activity activity)
Presents the consent screen ONLY if it is required by the used CMP (i.e. no user consent has been set yet).
- Parameters:
activity- The Activity from which the consent screen will be shown.
-
showIfNeededOrRejected
final Unit showIfNeededOrRejected(Integer daysAgo, 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.
- Parameters:
daysAgo- Minimum number of days that should be passed before re-showing the CMPactivity- The Activity from which the consent screen will be shown.
-
editConsent
final Unit editConsent(Activity activity)
Presents the consent screen, allowing the user to change consent settings.
- Parameters:
activity- The Activity from which the consent screen will be shown.
-
reload
final Unit reload(Activity activity)
Tells the CMP to reload. You can call this method for example after receiving ManagedConsentDelegate.managedConsentCMPFailedToLoad callback.
- Parameters:
activity- The Activity instance.
-
onConsentUpdated
Unit onConsentUpdated(ManagedConsent.ManagedConsentState state)
-
onCMPFailedToShow
Unit onCMPFailedToShow(String error)
-
onCMPFailedToLoad
Unit onCMPFailedToLoad(String error)
-
CMPNeedsUI
Unit CMPNeedsUI()
-
didShowCMP
Unit didShowCMP()
-
-
-
-