Known Direct Subclasses |
An AdRequest
contains
targeting information used to fetch an ad. Ad requests are created using AdRequest.Builder
.
Publishers using Ad Manager or Search Ads for Apps should use AdManagerAdRequest
or DynamicHeightSearchAdRequest
,
respectively.
Nested Class Summary
class | AdRequest.Builder | Builds an AdRequest . |
Constant Summary
String | DEVICE_ID_EMULATOR | The deviceId for emulators to be
used with
RequestConfiguration.Builder.setTestDeviceIds(List) . |
int | ERROR_CODE_APP_ID_MISSING | The ad request was not made due to a missing app ID. |
int | ERROR_CODE_INTERNAL_ERROR | Something happened internally; for instance, an invalid response was received from the ad server. |
int | ERROR_CODE_INVALID_AD_STRING | The ad string is invalid. |
int | ERROR_CODE_INVALID_REQUEST | The ad request was invalid; for instance, the ad unit ID was incorrect. |
int | ERROR_CODE_MEDIATION_NO_FILL | The mediation adapter did not fill the ad request. |
int | ERROR_CODE_NETWORK_ERROR | The ad request was unsuccessful due to network connectivity. |
int | ERROR_CODE_NO_FILL | The ad request was successful, but no ad was returned due to lack of ad inventory. |
int | ERROR_CODE_REQUEST_ID_MISMATCH | The AdInfo object inside the ad
request has mismatching request IDs or the request ID in the ad string is not
found. |
int | GENDER_FEMALE | Female gender. |
int | GENDER_MALE | Male gender. |
int | GENDER_UNKNOWN | Unknown gender. |
int | MAX_CONTENT_URL_LENGTH | The maximum content URL length. |
Public Method Summary
String |
getContentUrl()
Returns the content URL targeting information.
|
<T extends CustomEvent> Bundle |
getCustomEventExtrasBundle(Class<T>
adapterClass)
Returns extra parameters to pass to a specific custom event adapter.
|
Set<String> |
getKeywords()
Returns targeting information keywords.
|
List<String> |
getNeighboringContentUrls()
Returns the list of neighboring content URLs or an empty list if no URLs were
set.
|
<T extends MediationExtrasReceiver> Bundle |
getNetworkExtrasBundle(Class<T>
adapterClass)
Returns extra parameters to pass to a specific ad network adapter.
|
boolean |
Inherited Method Summary
Constants
public static final String DEVICE_ID_EMULATOR
The deviceId
for emulators to be used with
RequestConfiguration.Builder.setTestDeviceIds(List)
.
public static final int ERROR_CODE_APP_ID_MISSING
The ad request was not made due to a missing app ID.
public static final int ERROR_CODE_INTERNAL_ERROR
Something happened internally; for instance, an invalid response was received from the ad server.
public static final int ERROR_CODE_INVALID_AD_STRING
The ad string is invalid. For example, there is no request ID in the ad string.
public static final int ERROR_CODE_INVALID_REQUEST
The ad request was invalid; for instance, the ad unit ID was incorrect.
public static final int ERROR_CODE_MEDIATION_NO_FILL
The mediation adapter did not fill the ad request. If this error is returned from
AdError.getCode()
,
check AdError.getCause()
for the underlying cause.
public static final int ERROR_CODE_NETWORK_ERROR
The ad request was unsuccessful due to network connectivity.
public static final int ERROR_CODE_NO_FILL
The ad request was successful, but no ad was returned due to lack of ad inventory.
public static final int ERROR_CODE_REQUEST_ID_MISMATCH
The AdInfo
object inside the ad request has mismatching request IDs or
the request ID in the ad string is not found.
public static final int GENDER_FEMALE
Female gender.
public static final int GENDER_MALE
Male gender.
public static final int GENDER_UNKNOWN
Unknown gender.
public static final int MAX_CONTENT_URL_LENGTH
The maximum content URL length.
Public Methods
public String getContentUrl ()
Returns the content URL targeting information. Returns null
if the
contentUrl was not set.
public Bundle getCustomEventExtrasBundle (Class<T> adapterClass)
Returns extra parameters to pass to a specific custom event adapter. Returns
null
if no custom event extras of the provided type were set.
public Set<String> getKeywords ()
Returns targeting information keywords. Returns an empty Set
if no keywords
were added.
public List<String> getNeighboringContentUrls ()
Returns the list of neighboring content URLs or an empty list if no URLs were set.
public Bundle getNetworkExtrasBundle (Class<T> adapterClass)
Returns extra parameters to pass to a specific ad network adapter. Returns
null
if no network extras of the provided type were set.
public boolean isTestDevice (Context context)
Returns true
if this device will receive test ads.