Last active
March 11, 2022 13:25
-
-
Save BerkeCoban/447d08de0fa31afb253c64500a276471 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* TCF2.0 | |
*/ | |
val adParamBuilder = AdParam.Builder() | |
try { | |
val sharedPref = context.getSharedPreferences( | |
"SharedPreferences", | |
Context.MODE_PRIVATE | |
) | |
val tcfString = sharedPref?.getString("IABTCF_TCString", ""); | |
if (tcfString != null && tcfString != "") { | |
adParamBuilder.setConsent(tcfString) | |
Log.d(ADAPTER_NAME, "TCF 2.0 string has been set.") | |
} | |
} catch (exception: Exception) { | |
Log.e(ADAPTER_NAME, "Tcf String couldn't read.") | |
} | |
// call AdParam.Builder().Build() afterwards and use it for adrequests. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment