Package io.didomi.sdk.config
Class ConfigurationRepository
- java.lang.Object
-
- io.didomi.sdk.config.ConfigurationRepository
-
public class ConfigurationRepository extends java.lang.ObjectAppConfiguration manager
-
-
Constructor Summary
Constructors Constructor Description ConfigurationRepository(io.didomi.sdk.remote.RemoteFilesHelper remoteFilesHelper, io.didomi.sdk.ContextHelper contextHelper, io.didomi.sdk.DidomiInitializeParameters parameters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompleteVendorDeviceStorageDisclosures(Vendor vendor)Update the vendor device storage disclosures list from the URL specified in vendor model.java.lang.StringgetApiKey()io.didomi.sdk.config.AppConfigurationgetAppConfiguration()java.lang.StringgetDeploymentId()Getter for the consent notice deployment ID.IABConfigurationgetIabConfiguration()io.didomi.sdk.config.SDKConfigurationgetSdkConfiguration()booleanisConfigLoadedFromDidomi()voidload(android.content.Context context)Load the configuration from anywhere possiblevoidload(java.lang.String appConfigJson, java.lang.String sdkConfigJson, java.lang.String iabConfigJson, boolean useV2)Force to load a specific configurationstatic java.lang.StringreadFileFromAssets(android.content.Context context, java.lang.String path)Load the configuration from a local filebooleanshouldShowDismissButton(boolean isUserConsentStatusNotPartial)Method used to check if the close button should be shown to the user.booleanshouldUseV1()Determine if used TCF version is TCFV1 from app configurationbooleanshouldUseV2()Determine if used TCF version is TCFV2 from app configuration
-
-
-
Method Detail
-
load
public void load(@Nullable java.lang.String appConfigJson, @Nullable java.lang.String sdkConfigJson, @Nullable java.lang.String iabConfigJson, boolean useV2)Force to load a specific configuration- Parameters:
appConfigJson- Json for override app configuration, or null if should not overridesdkConfigJson- Json for override sdk configuration, or null if should not overrideiabConfigJson- Json for override IAB configuration, or null if should not overrideuseV2- Whether the desired config is in tcf v2
-
load
public void load(android.content.Context context) throws java.lang.ExceptionLoad the configuration from anywhere possible- Throws:
java.lang.Exception
-
shouldUseV2
public boolean shouldUseV2()
Determine if used TCF version is TCFV2 from app configuration- Returns:
-
shouldUseV1
public boolean shouldUseV1()
Determine if used TCF version is TCFV1 from app configuration- Returns:
-
getDeploymentId
@Nullable public java.lang.String getDeploymentId()
Getter for the consent notice deployment ID. This value comes from the notice_deployment_id field in the DynamoDB table.- Returns:
- deployment ID string if available, null otherwise.
-
readFileFromAssets
@Nullable public static java.lang.String readFileFromAssets(android.content.Context context, java.lang.String path) throws java.lang.ExceptionLoad the configuration from a local file- Parameters:
context-path-- Returns:
- Throws:
java.lang.Exception
-
getAppConfiguration
public io.didomi.sdk.config.AppConfiguration getAppConfiguration()
-
getIabConfiguration
public IABConfiguration getIabConfiguration()
-
getSdkConfiguration
public io.didomi.sdk.config.SDKConfiguration getSdkConfiguration()
-
getApiKey
public java.lang.String getApiKey()
-
isConfigLoadedFromDidomi
public boolean isConfigLoadedFromDidomi()
-
completeVendorDeviceStorageDisclosures
public void completeVendorDeviceStorageDisclosures(Vendor vendor)
Update the vendor device storage disclosures list from the URL specified in vendor model. This operation may involve network calls and should not be called from the UI thread.- Parameters:
vendor- the vendor to update
-
shouldShowDismissButton
public boolean shouldShowDismissButton(boolean isUserConsentStatusNotPartial)
Method used to check if the close button should be shown to the user.- Returns:
- true if Didomi logo should be hidden, false otherwise.
-
-