-
- All Implemented Interfaces:
-
io.didomi.sdk.iab.IABStorageRepository
public final class TCFV2StorageRepository implements IABStorageRepository
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegertcfVersionprivate final IntegerconsentScreenprivate final Integerversion
-
Constructor Summary
Constructors Constructor Description TCFV2StorageRepository()
-
Method Summary
Modifier and Type Method Description final IntegergetTcfVersion()Version of the TCF final IntegergetConsentScreen()Consent screen IntegergetVersion()Get the TCF version implemented by this repository (2) UnitclearCMPKeys(SharedPreferences sharedPreferences)Clear keys in SharedPreferences that belong to the TCFv1 This ensures that there is no v1 CMP in the app and that vendors will not try to read from v1 final List<Integer>getIABPurposeIds(Iterable<Purpose> purposes, Boolean isSpecialFeature)Get IAB IDs from a list of purposes final List<Integer>getIABVendorIds(Iterable<Vendor> vendors)Get IAB IDs from a list of vendors final List<PublisherRestrictionEntry>getPublisherRestrictionEntries(List<PublisherRestriction> publisherRestrictions)Convert Didomi publisher restriction to PublisherRestrictionEntry final StringtoBinaryString(List<Integer> ids, Integer size)Transform a list of IDs to a binary string UnitsaveConsentInformation(SharedPreferences sharedPreferences, Integer vendorListMaxVendorId, Integer vendorListVersion, ConsentToken consentToken, AppConfiguration appConfiguration, IABConfiguration vendorList, List<PublisherRestriction> publisherRestrictions, String languageCode)Save TCF consent information to the device https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2. UnitsetCMPPresent(SharedPreferences sharedPreferences)Create the required keys in SharedPreferences to indicate that a CMP is present in the app UnitsetSubjectToGDPR(SharedPreferences sharedPreferences, Boolean subjectToGDPR)Indicate whether the user is subject to GDPR or not StringgetUserConsentString(SharedPreferences sharedPreferences)Getter for user consent string -
-
Method Detail
-
getTcfVersion
final Integer getTcfVersion()
Version of the TCF
-
getConsentScreen
final Integer getConsentScreen()
Consent screen
-
getVersion
Integer getVersion()
Get the TCF version implemented by this repository (2)
-
clearCMPKeys
Unit clearCMPKeys(SharedPreferences sharedPreferences)
Clear keys in SharedPreferences that belong to the TCFv1 This ensures that there is no v1 CMP in the app and that vendors will not try to read from v1
-
getIABPurposeIds
final List<Integer> getIABPurposeIds(Iterable<Purpose> purposes, Boolean isSpecialFeature)
Get IAB IDs from a list of purposes
- Parameters:
purposes- List of purposesisSpecialFeature- Whether we want to return IDs from purposes (false) or special features (true)
-
getIABVendorIds
final List<Integer> getIABVendorIds(Iterable<Vendor> vendors)
Get IAB IDs from a list of vendors
- Parameters:
vendors- List of vendors
-
getPublisherRestrictionEntries
final List<PublisherRestrictionEntry> getPublisherRestrictionEntries(List<PublisherRestriction> publisherRestrictions)
Convert Didomi publisher restriction to PublisherRestrictionEntry
- Parameters:
publisherRestrictions- list of publisher restrictions
-
toBinaryString
final String toBinaryString(List<Integer> ids, Integer size)
Transform a list of IDs to a binary string
-
saveConsentInformation
Unit saveConsentInformation(SharedPreferences sharedPreferences, Integer vendorListMaxVendorId, Integer vendorListVersion, ConsentToken consentToken, AppConfiguration appConfiguration, IABConfiguration vendorList, List<PublisherRestriction> publisherRestrictions, String languageCode)
Save TCF consent information to the device https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#in-app-details
- Parameters:
vendorListMaxVendorId- Not usedvendorListVersion- Not usedconsentToken- Current user consent tokenappConfiguration- instance of AppConfigurationvendorList- TCF vendor listlanguageCode- 2-letter ISO language code for consent collection
-
setCMPPresent
Unit setCMPPresent(SharedPreferences sharedPreferences)
Create the required keys in SharedPreferences to indicate that a CMP is present in the app
-
setSubjectToGDPR
Unit setSubjectToGDPR(SharedPreferences sharedPreferences, Boolean subjectToGDPR)
Indicate whether the user is subject to GDPR or not
-
getUserConsentString
String getUserConsentString(SharedPreferences sharedPreferences)
Getter for user consent string
-
-
-
-