Android SDK Version
- AbstractAdListener
- Ad
- AdChoicesView
- AdError
- AdIconView
- AdListener
- AdOptionsView
- AdOptionsView.Orientation
- AdSettings
- AdSettings.IntegrationErrorMode
- AdSettings.MultiprocessSupportMode
- AdSettings.TestAdType
- AdSize
- AdView
- AudienceNetworkActivity
- AudienceNetworkAds
- AudienceNetworkAds.AdFormat
- AudienceNetworkAds.InitListener
- AudienceNetworkAds.InitResult
- AudienceNetworkAds.InitSettingsBuilder
- BidderTokenProvider
- CacheFlag
- DefaultMediaViewVideoRenderer
- ExtraHints
- ExtraHints.Builder
- ExtraHints.HintType
- ExtraHints.Keyword
- InstreamVideoAdListener
- InstreamVideoAdView
- InterstitialAd
- InterstitialAdExtendedListener
- InterstitialAdListener
- MediaView
- MediaViewListener
- MediaViewVideoRenderer
- MediaViewVideoRendererWithBackgroundPlayback
- NativeAd
- NativeAd.AdCreativeType
- NativeAdBase
- NativeAdBase.Image
- NativeAdBase.MediaCacheFlag
- NativeAdBase.NativeComponentTag
- NativeAdBase.Rating
- NativeAdLayout
- NativeAdListener
- NativeAdScrollView
- NativeAdScrollView.AdViewProvider
- NativeAdsManager
- NativeAdsManager.Listener
- NativeAdView
- NativeAdView.Type
- NativeAdViewAttributes
- NativeBannerAd
- NativeBannerAdView
- NativeBannerAdView.Type
- RewardData
- RewardedVideoAd
- RewardedVideoAdExtendedListener
- RewardedVideoAdListener
- S2SRewardedVideoAdExtendedListener
- S2SRewardedVideoAdListener
- VideoAutoplayBehavior
- VideoStartReason
- java.lang.Object
- com.facebook.ads.AdSettings
public class AdSettings
extends java.lang.Object
AdSettings contains global settings for all ad controls.
Since:
4.6
Nested Class Summary
Modifier and Type | Class and Description |
---|---|
static class | AdSettings.IntegrationErrorMode |
static class | AdSettings.MultiprocessSupportMode |
static class | AdSettings.TestAdType Ad Type to be returned when test mode is on. |
Field Summary
Modifier and Type | Field and Description |
---|---|
static boolean | DEBUG Deprecated. Use setDebugBuild(boolean) } instead. |
Method Summary
Modifier and Type | Method and Description |
---|---|
static void | addTestDevice(java.lang.String deviceIdHash) Adds a test device. |
static void | addTestDevices(java.util.Collection<java.lang.String> deviceIdHashes) Adds a collection of test devices. |
static void | clearTestDevices() Clears the collection of test devices. |
static java.lang.String | getMediationService() Returns the name of the mediation service that is mediating Audience Network |
static AdSettings.TestAdType | getTestAdType() |
static java.lang.String | getUrlPrefix() Gets the url prefix. |
static boolean | isChildDirected() Gets whether the ad control is targeting a child. |
static boolean | isTestMode(Context context) Gets whether ad controls are working in test mode. |
static boolean | isVideoAutoplay() Gets whether video autoplay is enabled |
static boolean | isVideoAutoplayOnMobile() Gets whether video autoplay is only enabled on Wifi or not |
static void | setDebugBuild(boolean isDebugBuild) Puts the SDK in debug mode |
static void | setIntegrationErrorMode(AdSettings.IntegrationErrorMode mode) Specify behaviour of the SDK when client code has an integration error. |
static void | setIsChildDirected(boolean childDirected) Sets whether the ad control is targeting a child. |
static void | setMediationService(java.lang.String mediationService) Sets the name of the mediation service that is mediating Audience Network. |
static void | setMultiprocessSupportMode(AdSettings.MultiprocessSupportMode mode) Specify if the SDK can load and show ads in the separate process. |
static void | setTestAdType(AdSettings.TestAdType testAdType) |
static void | setTestMode(boolean enabled) Sets whether ad controls are working in test mode. |
static void | setUrlPrefix(java.lang.String urlPrefix) Sets the url prefix to use when making requests. |
static void | setVideoAutoplay(boolean enabled) Sets the setting for video autoplay |
static void | setVideoAutoplayOnMobile(boolean enabled) Sets the setting for video autoplay on mobile networks |
static void | setVisibleAnimation(boolean enabled) |
static void | turnOnSDKDebugger(Context context) This is a feature in testing not currently supported |
Field Detail
Method Detail
setDebugBuild
public static void setDebugBuild(boolean isDebugBuild)
Puts the SDK in debug mode
This is useful for getting debug messages printed to logcat.
turnOnSDKDebugger
public static void turnOnSDKDebugger(Context context)
This is a feature in testing not currently supported
Parameters:
context
- Since:
5.3
addTestDevice
public static void addTestDevice(java.lang.String deviceIdHash)
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.Parameters:
deviceIdHash
- id of the device to use test mode, can be obtained from debug logSince:
4.6
addTestDevices
public static void addTestDevices(java.util.Collection<java.lang.String> deviceIdHashes)
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.Parameters:
deviceIdHashes
- ids of the device to use test mode, can be obtained from debug logSince:
4.6
clearTestDevices
public static void clearTestDevices()
Clears the collection of test devices.
Since:
4.6
isTestMode
public static boolean isTestMode(Context context)
Gets whether ad controls are working in test mode.
Parameters:
context
- android contextReturns:
whether in test mode
Since:
4.6
setTestMode
public static void setTestMode(boolean enabled)
Sets whether ad controls are working in test mode.
Parameters:
enabled
- test mode statesetUrlPrefix
public static void setUrlPrefix(java.lang.String urlPrefix)
Sets the url prefix to use when making requests. This should never be used in production.
Parameters:
urlPrefix
- url prefixSince:
4.6
getUrlPrefix
public static java.lang.String getUrlPrefix()
Gets the url prefix.
Returns:
url prefix
Since:
4.6
isVideoAutoplay
public static boolean isVideoAutoplay()
Gets whether video autoplay is enabled
Returns:
true if video autoplay is enabled
Since:
4.23
isVideoAutoplayOnMobile
public static boolean isVideoAutoplayOnMobile()
Gets whether video autoplay is only enabled on Wifi or not
Returns:
true if video autoplay is enabled only on Wifi
Since:
4.23
setVideoAutoplay
public static void setVideoAutoplay(boolean enabled)
Sets the setting for video autoplay
Parameters:
enabled
- whether video autoplay should be enabled or notSince:
4.23
setVideoAutoplayOnMobile
public static void setVideoAutoplayOnMobile(boolean enabled)
Sets the setting for video autoplay on mobile networks
Parameters:
enabled
- whether video autoplay should be enabled only on WifiSince:
4.23
setMediationService
public static void setMediationService(java.lang.String mediationService)
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.
Parameters:
mediationService
- string representing the name of the mediation service that is mediating Audience NetworkSince:
4.23
getMediationService
public static java.lang.String getMediationService()
Returns the name of the mediation service that is mediating Audience Network
Returns:
string representing the name of the mediation service if there is any
Since:
4.23
setIsChildDirected
public static void setIsChildDirected(boolean childDirected)
Sets whether the ad control is targeting a child.
Parameters:
childDirected
- whether the ad control is targeting a childSince:
4.6
isChildDirected
public static boolean isChildDirected()
Gets whether the ad control is targeting a child.
Returns:
whether the ad control is targeting a child
Since:
4.6
setTestAdType
public static void setTestAdType(AdSettings.TestAdType testAdType)
Parameters:
testAdType
- Since:
4.23
setVisibleAnimation
public static void setVisibleAnimation(boolean enabled)
setMultiprocessSupportMode
public static void setMultiprocessSupportMode(AdSettings.MultiprocessSupportMode mode)
Specify if the SDK can load and show ads in the separate process. See
AdSettings.MultiprocessSupportMode
. Default value is AdSettings.MultiprocessSupportMode.MULTIPROCESS_SUPPORT_MODE_AUTO
Since:
5.1
setIntegrationErrorMode
public static void setIntegrationErrorMode(AdSettings.IntegrationErrorMode mode)
Specify behaviour of the SDK when client code has an integration error. See
AdSettings.IntegrationErrorMode
Since:
5.1