Class PrebidMobile
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLogLevel for logging control.c NONE - no sdk logs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum refresh interval allowed.static final intMinimum refresh interval allowed.static booleanDeprecated.static PrebidMobile.LogLevelDeprecated.static final StringCurrently implemented MRAID version.static final StringCurrently implemented Native Ads version.static final StringOpen measurement SDK versionstatic final Stringstatic final Stringstatic final StringSDK name provided for MRAID_ENV inMraidEnvstatic final StringSDK versionstatic booleanDeprecated.static final StringTested Google SDK version.static booleanDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddStoredBidResponse(String bidder, String responseId) static voidassignNativeAssetID(boolean assignNativeAssetID) For assigning ID to the Assets in the Asset array (in Native Ad Request)static voidcheckGoogleMobileAdsCompatibility(String googleAdsVersion) Check Google Mobile Ads compatibility for original API.static voidstatic BooleancontainsPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer) Return whether SDK already registered this renderer.static android.content.ContextDeprecated.static Stringstatic intstatic intPriority Policy: PBSConfig > SDKConfig > DefaultReturns the HashMap containing a list of custom headers to add to requestsstatic LogUtil.PrebidLoggerstatic Stringstatic PrebidEventDelegatestatic List<ExternalUserId> Deprecated, for removal: This API element is subject to removal in a future version.static booleanstatic booleanstatic PrebidMobile.LogLevelstatic PBSConfigstatic booleanstatic Stringstatic Hoststatic Stringstatic intstatic voidinitializeSdk(android.content.Context context, String serverURL, SdkInitializationListener listener) Initializes the main SDK classes and makes request to Prebid server to check its status.static voidinitializeSdk(android.content.Context context, SdkInitializationListener listener) Deprecated.Please, useinitializeSdk(Context, String, SdkInitializationListener)} instead.static booleanReturn 'true' if Prebid Rendering SDK is initialized completelystatic booleanstatic booleanuseCacheForReportingWithRenderingApistatic voidregisterPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer) Registers plugin renderer for displaying ad in custom wrapper.static voidsetAuctionSettingsId(String settingsId) static voidsetCreativeFactoryTimeout(int creativeFactoryTimeout) Sets creative factory timeout.static voidsetCreativeFactoryTimeoutPreRenderContent(int creativeFactoryTimeoutPreRenderContent) Sets creative factory timeout for prerender content.static voidsetCustomHeaders(HashMap<String, String> customHeaders) HashMap containing a list of custom headers to add to requestsstatic voidsetCustomLogger(LogUtil.PrebidLogger logger) Sets custom logger for the SDK.static voidSets full valid URL for the /status endpoint of the PBS.static voidsetDisableStatusCheck(boolean disableStatusCheck) static voidsetEventDelegate(PrebidEventDelegate eventDelegate) Sets thePrebidEventDelegateinstance to handle the auction request and response from the SDK.static voidsetExternalUserIds(List<ExternalUserId> externalUserIds) Deprecated, for removal: This API element is subject to removal in a future version.static booleansetIncludeBidderKeysFlag(boolean includeBidderKeys) Sets 'includebidderkeys' parameter for ad request to receive additional info about bidders.static voidsetIncludeWinnersFlag(boolean includeWinners) Sets 'includewinners' parameter for ad request to receive additional info about winners in response.static voidsetLogLevel(PrebidMobile.LogLevel logLevel) Sets log level for the SDK.static voidsetPbsConfig(PBSConfig pbsConfig) static voidsetPbsDebug(boolean pbsDebug) static voidsetPrebidServerAccountId(String accountId) static voidsetPrebidServerHost(Host host) Deprecated.In the upcoming major release, the method will be removed.static voidsetShareGeoLocation(boolean share) Allows the SDK to share geolocation if permission is granted by the user.static voidsetStoredAuctionResponse(String storedAuctionResponse) Sets stored auction response for testing purposes.static voidsetTimeoutMillis(int timeoutMillis) Sets connection timeout for bid request.static voidsetUseCacheForReportingWithRenderingApi(boolean useCacheForReportingWithRenderingApi) Sets boolean for caching ad for rendering API.static booleanstatic booleanstatic voidunregisterPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer) Remove plugin renderer.
-
Field Details
-
isCoppaEnabled
Deprecated.In the upcoming major release, the property will be removed. -
useExternalBrowser
Deprecated.In the upcoming major release, the property will be removed. -
sendMraidSupportParams
Deprecated.In the upcoming major release, the property will be replaced with the method to setup supported MRAID versions. If true, the SDK sends "af=3,5,6", indicating support for MRAID -
AUTO_REFRESH_DELAY_MIN
public static final int AUTO_REFRESH_DELAY_MINMinimum refresh interval allowed. 30 seconds- See Also:
-
AUTO_REFRESH_DELAY_MAX
public static final int AUTO_REFRESH_DELAY_MAXMaximum refresh interval allowed. 120 seconds- See Also:
-
SCHEME_HTTPS
- See Also:
-
SCHEME_HTTP
- See Also:
-
SDK_VERSION
SDK version- See Also:
-
SDK_NAME
SDK name provided for MRAID_ENV inMraidEnv- See Also:
-
MRAID_VERSION
Currently implemented MRAID version.- See Also:
-
NATIVE_VERSION
Currently implemented Native Ads version.- See Also:
-
OMSDK_VERSION
Open measurement SDK version- See Also:
-
TESTED_GOOGLE_SDK_VERSION
Tested Google SDK version.- See Also:
-
logLevel
Deprecated.Please usesetLogLevel(LogLevel), this field will become private in next releases.
-
-
Method Details
-
isUseCacheForReportingWithRenderingApi
public static boolean isUseCacheForReportingWithRenderingApi()useCacheForReportingWithRenderingApi -
setUseCacheForReportingWithRenderingApi
public static void setUseCacheForReportingWithRenderingApi(boolean useCacheForReportingWithRenderingApi) Sets boolean for caching ad for rendering API.- Parameters:
useCacheForReportingWithRenderingApi-
-
getTimeoutMillis
public static int getTimeoutMillis() -
setTimeoutMillis
public static void setTimeoutMillis(int timeoutMillis) Sets connection timeout for bid request. -
setPrebidServerAccountId
-
getPrebidServerAccountId
-
setPrebidServerHost
Deprecated.In the upcoming major release, the method will be removed. Please, useinitializeSdk(Context, String, SdkInitializationListener)} -
getPrebidServerHost
-
setAuctionSettingsId
-
getAuctionSettingsId
-
setExternalUserIds
@Deprecated(forRemoval=true) public static void setExternalUserIds(List<ExternalUserId> externalUserIds) Deprecated, for removal: This API element is subject to removal in a future version.List containing objects that hold External User UniqueId parameters for the current application user. -
getExternalUserIds
Deprecated, for removal: This API element is subject to removal in a future version.Returns the List that hold External UserId parameters for the current application user- Returns:
- externalUserIds as Array.
-
setCustomHeaders
HashMap containing a list of custom headers to add to requests -
getCustomHeaders
Returns the HashMap containing a list of custom headers to add to requests- Returns:
- externalUserIds as Array.
-
initializeSdk
@Deprecated public static void initializeSdk(android.content.Context context, SdkInitializationListener listener) Deprecated.Please, useinitializeSdk(Context, String, SdkInitializationListener)} instead.Initializes the main SDK classes and makes request to Prebid server to check its status. You have to set host url (setPrebidServerHost(Host)) before calling this method. If you use custom /status endpoint set it with (setCustomStatusEndpoint(String)) before starting initialization.Calls SdkInitializationListener callback with enum initialization status parameter:
SUCCEEDED - Prebid SDK is initialized successfully and ready to work.
FAILED - Prebid SDK is failed to initialize and is not able to work.
SERVER_STATUS_WARNING - Prebid SDK failed to check the PBS status. The SDK is initialized and able to work, though.
To get the description of the problem you can call
InitializationStatus.getDescription()- Parameters:
context- any context (must be not null)listener- initialization listener (can be null).
-
initializeSdk
public static void initializeSdk(android.content.Context context, String serverURL, SdkInitializationListener listener) Initializes the main SDK classes and makes request to Prebid server to check its status. If you use custom /status endpoint set it with (setCustomStatusEndpoint(String)) before starting initialization.Calls SdkInitializationListener callback with enum initialization status parameter:
SUCCEEDED - Prebid SDK is initialized successfully and ready to work.
FAILED - Prebid SDK is failed to initialize and is not able to work.
SERVER_STATUS_WARNING - Prebid SDK failed to check the PBS status. The SDK is initialized and able to work, though.
To get the description of the problem you can call
InitializationStatus.getDescription()- Parameters:
context- any context (must be not null)serverURL- the Prebid Server URLlistener- initialization listener (can be null).
-
getApplicationContext
Deprecated. -
setStoredAuctionResponse
Sets stored auction response for testing purposes. -
getStoredAuctionResponse
-
addStoredBidResponse
-
clearStoredBidResponses
public static void clearStoredBidResponses() -
getStoredBidResponses
-
getPbsDebug
public static boolean getPbsDebug() -
setPbsDebug
public static void setPbsDebug(boolean pbsDebug) -
shouldAssignNativeAssetID
public static boolean shouldAssignNativeAssetID()- Returns:
- boolean that states if the ID will be set to the Asset array (in the Native Ad Request)
This value can be set using the
assignNativeAssetID(boolean)
-
assignNativeAssetID
public static void assignNativeAssetID(boolean assignNativeAssetID) For assigning ID to the Assets in the Asset array (in Native Ad Request) -
isSdkInitialized
public static boolean isSdkInitialized()Return 'true' if Prebid Rendering SDK is initialized completely -
getLogLevel
-
setLogLevel
Sets log level for the SDK. -
getCustomLogger
-
setCustomLogger
Sets custom logger for the SDK. -
checkGoogleMobileAdsCompatibility
Check Google Mobile Ads compatibility for original API. Show logs if version is not compatible.- Parameters:
googleAdsVersion- - MobileAds.getVersion().toString()
-
setCustomStatusEndpoint
Sets full valid URL for the /status endpoint of the PBS. Request to /status is sent when you callinitializeSdk(Context, SdkInitializationListener).- See Also:
-
getCustomStatusEndpoint
-
setIncludeWinnersFlag
public static void setIncludeWinnersFlag(boolean includeWinners) Sets 'includewinners' parameter for ad request to receive additional info about winners in response. -
getIncludeWinnersFlag
public static boolean getIncludeWinnersFlag() -
setIncludeBidderKeysFlag
public static boolean setIncludeBidderKeysFlag(boolean includeBidderKeys) Sets 'includebidderkeys' parameter for ad request to receive additional info about bidders. -
getIncludeBidderKeysFlag
public static boolean getIncludeBidderKeysFlag() -
getPbsConfig
-
setPbsConfig
-
getCreativeFactoryTimeout
public static int getCreativeFactoryTimeout() -
setCreativeFactoryTimeout
public static void setCreativeFactoryTimeout(int creativeFactoryTimeout) Sets creative factory timeout. It's time to parse and render banner ads.- Parameters:
creativeFactoryTimeout- in ms (default 6000ms)
-
getCreativeFactoryTimeoutPreRenderContent
public static int getCreativeFactoryTimeoutPreRenderContent()Priority Policy: PBSConfig > SDKConfig > Default- Returns:
- creativeFactoryTimeoutPreRender in ms
-
setCreativeFactoryTimeoutPreRenderContent
public static void setCreativeFactoryTimeoutPreRenderContent(int creativeFactoryTimeoutPreRenderContent) Sets creative factory timeout for prerender content. It's time to parse and render interstitial ads.- Parameters:
creativeFactoryTimeoutPreRenderContent- in ms (default 30000ms)
-
registerPluginRenderer
Registers plugin renderer for displaying ad in custom wrapper. Prebid SDK will choose this renderer only if the winning bid contains this renderer. -
unregisterPluginRenderer
Remove plugin renderer.registerPluginRenderer(PrebidMobilePluginRenderer) -
containsPluginRenderer
Return whether SDK already registered this renderer. -
getEventDelegate
-
setEventDelegate
Sets thePrebidEventDelegateinstance to handle the auction request and response from the SDK. This allows the SDK to collect some statistical data. The provided delegate will be stored as a weak reference so you need to store reference to it.- Parameters:
eventDelegate- the instance ofPrebidEventDelegateto handle events from the SDK. Can be null to clear the existing delegate.
-
setDisableStatusCheck
public static void setDisableStatusCheck(boolean disableStatusCheck) - Parameters:
disableStatusCheck- boolean flag for skipping status check If true, the SDK will not check the PBS status during initialization. This will save initialization time if the PBS endpoint is always live and handled client side
-
shouldDisableStatusCheck
public static boolean shouldDisableStatusCheck()
-
TargetingParams.getExternalUserIds()