Class OmidServiceLocalSource
-
- All Implemented Interfaces:
public final class OmidServiceLocalSourceA 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.
-
-
Constructor Summary
Constructors Constructor Description OmidServiceLocalSource(Context context)
-
Method Summary
Modifier and Type Method Description final BooleanisOmidJsExpired(AdConfig.OmidConfig omidConfig)Checks if the locally stored OMID JavaScript is expired. final StringgetOmidJs()Retrieves the locally stored OMID JavaScript. final <Error class: unknown class>saveOmidJs(String omidJsResponse)Saves a new OMID JavaScript to local storage. -
-
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:
trueif the OMID JavaScript is expired,falseotherwise.
-
getOmidJs
final String getOmidJs()
Retrieves the locally stored OMID JavaScript.
- Returns:
The OMID JavaScript as a String, or
nullif 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.
-
-
-
-