Class ConfigurationRepository


  • public class ConfigurationRepository
    extends java.lang.Object
    AppConfiguration 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
      void completeVendorDeviceStorageDisclosures​(Vendor vendor)
      Update the vendor device storage disclosures list from the URL specified in vendor model.
      java.lang.String getApiKey()  
      io.didomi.sdk.config.AppConfiguration getAppConfiguration()  
      java.lang.String getDeploymentId()
      Getter for the consent notice deployment ID.
      IABConfiguration getIabConfiguration()  
      io.didomi.sdk.config.SDKConfiguration getSdkConfiguration()  
      boolean isConfigLoadedFromDidomi()  
      void load​(android.content.Context context)
      Load the configuration from anywhere possible
      void load​(java.lang.String appConfigJson, java.lang.String sdkConfigJson, java.lang.String iabConfigJson, boolean useV2)
      Force to load a specific configuration
      static java.lang.String readFileFromAssets​(android.content.Context context, java.lang.String path)
      Load the configuration from a local file
      boolean shouldShowDismissButton​(boolean isUserConsentStatusNotPartial)
      Method used to check if the close button should be shown to the user.
      boolean shouldUseV1()
      Determine if used TCF version is TCFV1 from app configuration
      boolean shouldUseV2()
      Determine if used TCF version is TCFV2 from app configuration
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigurationRepository

        public ConfigurationRepository​(io.didomi.sdk.remote.RemoteFilesHelper remoteFilesHelper,
                                       io.didomi.sdk.ContextHelper contextHelper,
                                       io.didomi.sdk.DidomiInitializeParameters parameters)
    • 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 override
        sdkConfigJson - Json for override sdk configuration, or null if should not override
        iabConfigJson - Json for override IAB configuration, or null if should not override
        useV2 - Whether the desired config is in tcf v2
      • load

        public void load​(android.content.Context context)
                  throws java.lang.Exception
        Load 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.Exception
        Load the configuration from a local file
        Parameters:
        context -
        path -
        Returns:
        Throws:
        java.lang.Exception
      • getAppConfiguration

        public io.didomi.sdk.config.AppConfiguration getAppConfiguration()
      • 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.