TWMAdRequest

class TWMAdRequest

An TWMAdRequest contains targeting information used to fetch an ad.

Constructors

TWMAdRequest
Link copied to clipboard
fun TWMAdRequest()

Types

Companion
Link copied to clipboard
object Companion
ErrorCode
Link copied to clipboard
enum ErrorCode : Enum<TWMAdRequest.ErrorCode>
Gender
Link copied to clipboard
enum Gender : Enum<TWMAdRequest.Gender>
The gender information used by TWMAdRequest.setGender

Properties

birthday
Link copied to clipboard
var birthday: Date? = null
The birthday information set by setBirthday.
birthdayStr
Link copied to clipboard
val birthdayStr: String
The birthday information set by setBirthday.
genderMark
Link copied to clipboard
val genderMark: String
The gender M or F set by setGender.

Functions

addTestDevice
Link copied to clipboard
fun addTestDevice(testDevice: String): TWMAdRequest
Specify the test device information
getChildDirectedTreatment
Link copied to clipboard
fun getChildDirectedTreatment(): Boolean
To query whether the ad request is treated as child-directed.
getDeviceTestMark
Link copied to clipboard
fun getDeviceTestMark(context: Context?): String
Used to configure native ad requests.
getProperties
Link copied to clipboard
fun getProperties(): Map<String, String>?
Get the property value by a specific name.
getPropertyByKey
Link copied to clipboard
fun getPropertyByKey(key: String): String?
Get the property value by a specific name.
isTestDevice
Link copied to clipboard
fun isTestDevice(context: Context?): Boolean
Check whether the request is in test device mode.
setBirthday
Link copied to clipboard
fun setBirthday(birthday: Calendar?): TWMAdRequest
Set birthday information.
fun setBirthday(birthday: Date?): TWMAdRequest
Set birthday information.
setChildDirectedTreatment
Link copied to clipboard
fun setChildDirectedTreatment(treatment: Boolean)
To specify whether you would like your app to be treated as child-directed.
setGender
Link copied to clipboard
fun setGender(gender: TWMAdRequest.Gender): TWMAdRequest
Set gender information.
setLocation
Link copied to clipboard
fun setLocation(location: Location?): TWMAdRequest
Set location information.
setNativeAdOptions
Link copied to clipboard
fun setNativeAdOptions(adOptions: Array<TWMNativeAdOptions>)
Used to configure native ad requests.
setProperties
Link copied to clipboard
fun setProperties(properties: MutableMap<String, String>?): TWMAdRequest
Set multiple key-value properties into TWMAdRequest.
setProperty
Link copied to clipboard
fun setProperty(key: String, value: String): TWMAdRequest
Set single key-value property into TWMAdRequest.
setTestDevices
Link copied to clipboard
fun setTestDevices(testDevices: MutableSet<String>?): TWMAdRequest
Specify the test device information