AppConsentSDK

public final class AppConsentSDK extends AbstractAppConsent

CMP entry point. This allows you to initiate the CMP when you need it, and to check that it has been properly initialized and started.

Once this has been done, all you need to do is retrieve the com.sfbx.appconsent.AppConsent object from the onReady Callback into AppConsentSDK.initialize method and display the CMP to your users.

Functions

Link copied to clipboard

Finds out whether all consent items have been accepted by the user

Link copied to clipboard

Finds out whether all stack items have been accepted by the user

Link copied to clipboard

Finds out whether all vendor items have been accepted by the user

Link copied to clipboard
public Unit checkForUpdate(Function1<Boolean, Unit> onResult, Function1<Throwable, Unit> error)

Check if update is needed. For example, if your Notice has been updated If called prior to user giving a consent returns false

Link copied to clipboard
public Unit clearCache()

Clear all applications SharedPreferences

Link copied to clipboard
public Unit clearConsent()

Clear user consent stored locally in applications SharedPreferences

Link copied to clipboard
public Boolean consentableAllowed(Integer iabId, ACConsentableType consentableType)

Checks whether a consent has been authorized

Link copied to clipboard

Check if user gave consent

Link copied to clipboard

Checks whether an extra consent has been authorized

Link copied to clipboard

Shows whether or not floating purpose has been authorized for a given extraId.

Link copied to clipboard

Checks whether a Extra Vendor has been authorized

Link copied to clipboard

Check if user gave consent for Geolocation purpose

Link copied to clipboard

Returns a list of consentables

Link copied to clipboard

Return a list of all Extra Vendors

Link copied to clipboard

Retrieves the list of your external id's, previously stored

Link copied to clipboard
public final static AppConsent getInstance()

Retrieves the CMP if it has been initialized

Link copied to clipboard
public String getUserId()

Get the advertising id used by Appconsent. if isLimitedTrackingEnabled() == false, it will be Provider (Google, Amazon, etc.) ADID otherwise a random UUID

Link copied to clipboard
public final static Unit initialize(String appKey, Function1<AppConsent, Unit> onReady)
public final static Unit initialize(String appKey, ACConfiguration configuration, Function1<AppConsent, Unit> onReady)

The main method, which allows you to initialize AppConsent with a default configuration or a custom configuration ACConfiguration like theme AppConsentTVTheme or force the application of GRPD whatever the region for example. By default, you will only need the appKey provided by the SFBX platform AND the callback onReady.

Link copied to clipboard

Find out if your Floating Purpose needs updating or not

Link copied to clipboard

Finds out whether or not the user has explicitly limited his or her advertising tracking

Link copied to clipboard
public final static Boolean isSdkInitialized()

Find out whether the CMP has already been initialized, and if so, enable you to retrieve it and start/continue using it.

Link copied to clipboard

Return true if user is subject to GDPR. It depends on forceApplyGDPR into com.sfbx.appconsent.tv.model.ACConfiguration and phone's locale.

Link copied to clipboard
@Deprecated(message = "Don't use this method! With the exception of a problem during sdk initialization if an error message indicates that the context is not loaded in the SDK.", level = DeprecationLevel.WARNING, replaceWith = @ReplaceWith(imports = {}, expression = "Automatic injection from the AppConsent provider."))
public final static Unit loadContext(Context context)

Used by AppConsentContentProvider to inject Context automatically when the application is run.

Link copied to clipboard
public Unit save(Function1<Boolean, Unit> onResult, Function1<Throwable, Unit> onError)

Saves the current state of user selections made on the CMP to the server

Link copied to clipboard
@Deprecated(message = "Don't use it !", replaceWith = @ReplaceWith(imports = {}, expression = "externalIds"), level = DeprecationLevel.WARNING)
public Unit saveExternalIds(Function0<Unit> success, Function1<Throwable, Unit> failed)

Send the external ids you have stored to the server. setExternalIds

Link copied to clipboard
public Unit saveFloatingPurposes(Map<String, Boolean> floatingPurposes, Function0<Unit> success, Function1<Throwable, Unit> failed)

Send and save your floatingpurposes on the server.

Link copied to clipboard
public Unit setConsentableConsents(Map<Integer, ACConsentStatus> consents, Function0<Unit> success, Function1<Throwable, Unit> error)

Defines the new status of consentables passed in parameter.

Link copied to clipboard
public Unit setExternalIds(Map<String, String> externalIds)

Store a set of external id's to allow you to send them to the server later with the saveExternalIds method.

Link copied to clipboard
public Unit setExtraConsentableConsents(Map<String, ACConsentStatus> consents, Function0<Unit> success, Function1<Throwable, Unit> error)

Defines the new status of extra consentables passed in parameter.

Link copied to clipboard
public Unit setOnPresentNoticeListener(OnPresentNoticeListener onPresentNoticeListener)

Set a listener to be notified when user has given his consent

Link copied to clipboard
public Boolean stackAllowed(Integer stackId)

Checks whether a stack has been authorized

Link copied to clipboard

Try to display the CMP; display is controlled by functional rules

Link copied to clipboard

Finds out whether all consent, stack, vendor items have been accepted by the user

Link copied to clipboard
public Boolean vendorAllowed(Integer vendorIabId)

Checks whether a IAB Vendor has been authorized