AdSettings contains global settings for all ad controls.
ขยาย: | Object |
แพ็คเกจ: | ads |
AdSettings()
public AdSettings()
addTestDevice(String)
Adds a test device.
Copy the current device Id from debug log and add it as a test device to get test ads. Apps running on emulator will automatically get test ads. Test devices should be added before Ad.loadAd() is called.
public static void addTestDevice(String deviceIdHash)
พารามิเตอร์ | คำอธิบาย |
---|---|
deviceIdHash | Id of the device to use test mode, can be obtained from debug log |
addTestDevices(Collection)
Adds a collection of test devices.
Copy the current device Id from debug log and add it as a test device to get test ads. Apps running on emulator will automatically get test ads. Test devices should be added before Ad.loadAd() is called.
public static void addTestDevices(Collection deviceIdHashes)
พารามิเตอร์ | คำอธิบาย |
---|---|
deviceIdHashes | Ids of the device to use test mode, can be obtained from debug log |
clearTestDevices()
Clears the collection of test devices.
public static void clearTestDevices()
isTestMode(Context)
Gets whether ad controls are working in test mode.
public static boolean isTestMode(Context context)
พารามิเตอร์ | คำอธิบาย |
---|---|
context | Android context |
setMediationService(String)
Sets the name of the mediation service that is mediating Audience Network.
If an ad provider service is mediating Audience Network in their sdk, it is required to set the name of the mediation service.
public static void setMediationService(String mediationService)
พารามิเตอร์ | คำอธิบาย |
---|---|
mediationService | String representing the name of the mediation service that is mediating Audience Network |
getMediationService()
Returns the name of the mediation service that is mediating Audience Network
public static String getMediationService()
setUrlPrefix(String)
Sets the url prefix to use when making requests. This method should never be used in production.
public static void setUrlPrefix(String urlPrefix)
พารามิเตอร์ | คำอธิบาย |
---|---|
urlPrefix | Url prefix |
getUrlPrefix()
Gets the url prefix.
public static String getUrlPrefix()
setIsChildDirected(boolean)
Sets whether the ad control is targeting a child.
public static void setIsChildDirected(boolean childDirected)
พารามิเตอร์ | คำอธิบาย |
---|---|
childDirected | Whether the ad control is targeting a child |
isChildDirected()
Gets whether the ad control is targeting a child.
public static boolean isChildDirected()
DEBUG
public static final boolean DEBUG