Class OmidServiceLocalSource

  • All Implemented Interfaces:

    
    public final class OmidServiceLocalSource
    
                        

    A local data source for managing the OMID (Open Measurement Interface Definition) JavaScript.

    This class provides methods to check if the locally stored OMID JavaScript is expired, retrieve the OMID JavaScript from local storage, and save a new OMID JavaScript to local storage. It uses a PrefDao to interact with shared preferences.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Boolean isOmidJsExpired(AdConfig.OmidConfig omidConfig) Checks if the locally stored OMID JavaScript is expired.
      final String getOmidJs() Retrieves the locally stored OMID JavaScript.
      final <Error class: unknown class> saveOmidJs(String omidJsResponse) Saves a new OMID JavaScript to local storage.
      • Methods inherited from class java.lang.Object

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

      • OmidServiceLocalSource

        OmidServiceLocalSource(Context context)
    • Method Detail

      • isOmidJsExpired

         final Boolean isOmidJsExpired(AdConfig.OmidConfig omidConfig)

        Checks if the locally stored OMID JavaScript is expired.

        This method calculates the age of the locally stored OMID JavaScript and compares it to the expiry time specified in the OmidConfig.

        Parameters:
        omidConfig - The OMID configuration containing the expiry time.
        Returns:

        true if the OMID JavaScript is expired, false otherwise.

      • getOmidJs

         final String getOmidJs()

        Retrieves the locally stored OMID JavaScript.

        Returns:

        The OMID JavaScript as a String, or null if it's not found.

      • saveOmidJs

         final <Error class: unknown class> saveOmidJs(String omidJsResponse)

        Saves a new OMID JavaScript to local storage.

        This method updates the locally stored OMID JavaScript and its last updated timestamp.

        Parameters:
        omidJsResponse - The OMID JavaScript to save.