Package org.prebid.mobile
Class PrebidMobile
- java.lang.Object
-
- org.prebid.mobile.PrebidMobile
-
public class PrebidMobile extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrebidMobile.LogLevelLogLevel for logging control.
-
Field Summary
Fields Modifier and Type Field Description static intAUTO_REFRESH_DELAY_MAXMaximum refresh interval allowed.static intAUTO_REFRESH_DELAY_MINMinimum refresh interval allowed.static booleanisCoppaEnabledstatic PrebidMobile.LogLevellogLevelDeprecated.static java.lang.StringMRAID_VERSIONCurrently implemented MRAID version.static java.lang.StringNATIVE_VERSIONCurrently implemented Native Ads version.static java.lang.StringOMSDK_VERSIONOpen measurement SDK versionstatic java.lang.StringSCHEME_HTTPstatic java.lang.StringSCHEME_HTTPSstatic java.lang.StringSDK_NAMESDK name provided for MRAID_ENV inMraidEnvstatic java.lang.StringSDK_VERSIONSDK versionstatic booleansendMraidSupportParamsIf true, the SDK sends "af=3,5", indicating support for MRAIDstatic java.lang.StringTESTED_GOOGLE_SDK_VERSIONTested Google SDK version.static booleanuseExternalBrowser
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddStoredBidResponse(java.lang.String bidder, java.lang.String responseId)static voidassignNativeAssetID(boolean assignNativeAssetID)For assigning ID to the Assets in the Asset array (in Native Ad Request)static voidcheckGoogleMobileAdsCompatibility(java.lang.String googleAdsVersion)Check Google Mobile Ads compatibility for original API.static voidclearStoredBidResponses()static java.lang.BooleancontainsPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer)static android.content.ContextgetApplicationContext()Deprecated.static intgetCreativeFactoryTimeout()Priority Policy: PBSConfig > SDKConfig > Defaultstatic intgetCreativeFactoryTimeoutPreRenderContent()Priority Policy: PBSConfig > SDKConfig > Defaultstatic java.util.HashMap<java.lang.String,java.lang.String>getCustomHeaders()Returns the HashMap containing a list of custom headers to add to requestsstatic LogUtil.PrebidLoggergetCustomLogger()static java.lang.StringgetCustomStatusEndpoint()static java.util.List<ExternalUserId>getExternalUserIds()Returns the List that hold External UserId parameters for the current application userstatic booleangetIncludeBidderKeysFlag()static booleangetIncludeWinnersFlag()static PrebidMobile.LogLevelgetLogLevel()static PBSConfiggetPbsConfig()static booleangetPbsDebug()static java.lang.StringgetPrebidServerAccountId()static HostgetPrebidServerHost()static java.lang.StringgetStoredAuctionResponse()static java.util.Map<java.lang.String,java.lang.String>getStoredBidResponses()static intgetTimeoutMillis()static voidinitializeSdk(android.content.Context context, SdkInitializationListener listener)Initializes the main SDK classes and makes request to Prebid server to check its status.static booleanisSdkInitialized()Return 'true' if Prebid Rendering SDK is initialized completelystatic booleanisShareGeoLocation()static booleanisUseCacheForReportingWithRenderingApi()static voidregisterPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer)static voidsetCreativeFactoryTimeout(int creativeFactoryTimeout)static voidsetCreativeFactoryTimeoutPreRenderContent(int creativeFactoryTimeoutPreRenderContent)static voidsetCustomHeaders(java.util.HashMap<java.lang.String,java.lang.String> customHeaders)HashMap containing a list of custom headers to add to requestsstatic voidsetCustomLogger(LogUtil.PrebidLogger logger)static voidsetCustomStatusEndpoint(java.lang.String url)Sets full valid URL for the /status endpoint of the PBS.static voidsetExternalUserIds(java.util.List<ExternalUserId> externalUserIds)List containing objects that hold External User Id parameters for the current application user.static booleansetIncludeBidderKeysFlag(boolean includeBidderKeys)static voidsetIncludeWinnersFlag(boolean includeWinners)static voidsetLogLevel(PrebidMobile.LogLevel logLevel)static voidsetPbsConfig(PBSConfig pbsConfig)static voidsetPbsDebug(boolean pbsDebug)static voidsetPrebidServerAccountId(java.lang.String accountId)static voidsetPrebidServerHost(Host host)static voidsetShareGeoLocation(boolean share)static voidsetStoredAuctionResponse(java.lang.String storedAuctionResponse)static voidsetTimeoutMillis(int timeoutMillis)static voidsetUseCacheForReportingWithRenderingApi(boolean useCacheForReportingWithRenderingApi)static booleanshouldAssignNativeAssetID()static voidunregisterPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer)
-
-
-
Field Detail
-
isCoppaEnabled
public static boolean isCoppaEnabled
-
useExternalBrowser
public static boolean useExternalBrowser
-
sendMraidSupportParams
public static boolean sendMraidSupportParams
If true, the SDK sends "af=3,5", indicating support for MRAID
-
AUTO_REFRESH_DELAY_MIN
public static final int AUTO_REFRESH_DELAY_MIN
Minimum refresh interval allowed. 30 seconds- See Also:
- Constant Field Values
-
AUTO_REFRESH_DELAY_MAX
public static final int AUTO_REFRESH_DELAY_MAX
Maximum refresh interval allowed. 120 seconds- See Also:
- Constant Field Values
-
SCHEME_HTTPS
public static final java.lang.String SCHEME_HTTPS
- See Also:
- Constant Field Values
-
SCHEME_HTTP
public static final java.lang.String SCHEME_HTTP
- See Also:
- Constant Field Values
-
SDK_VERSION
public static final java.lang.String SDK_VERSION
SDK version- See Also:
- Constant Field Values
-
SDK_NAME
public static final java.lang.String SDK_NAME
SDK name provided for MRAID_ENV inMraidEnv- See Also:
- Constant Field Values
-
MRAID_VERSION
public static final java.lang.String MRAID_VERSION
Currently implemented MRAID version.- See Also:
- Constant Field Values
-
NATIVE_VERSION
public static final java.lang.String NATIVE_VERSION
Currently implemented Native Ads version.- See Also:
- Constant Field Values
-
OMSDK_VERSION
public static final java.lang.String OMSDK_VERSION
Open measurement SDK version- See Also:
- Constant Field Values
-
TESTED_GOOGLE_SDK_VERSION
public static final java.lang.String TESTED_GOOGLE_SDK_VERSION
Tested Google SDK version.- See Also:
- Constant Field Values
-
logLevel
@Deprecated public static PrebidMobile.LogLevel logLevel
Deprecated.Please usesetLogLevel(LogLevel), this field will become private in next releases.
-
-
Method Detail
-
isUseCacheForReportingWithRenderingApi
public static boolean isUseCacheForReportingWithRenderingApi()
-
setUseCacheForReportingWithRenderingApi
public static void setUseCacheForReportingWithRenderingApi(boolean useCacheForReportingWithRenderingApi)
-
getTimeoutMillis
public static int getTimeoutMillis()
-
setTimeoutMillis
public static void setTimeoutMillis(int timeoutMillis)
-
setPrebidServerAccountId
public static void setPrebidServerAccountId(java.lang.String accountId)
-
getPrebidServerAccountId
public static java.lang.String getPrebidServerAccountId()
-
setPrebidServerHost
public static void setPrebidServerHost(Host host)
-
getPrebidServerHost
public static Host getPrebidServerHost()
-
setShareGeoLocation
public static void setShareGeoLocation(boolean share)
-
isShareGeoLocation
public static boolean isShareGeoLocation()
-
setExternalUserIds
public static void setExternalUserIds(java.util.List<ExternalUserId> externalUserIds)
List containing objects that hold External User Id parameters for the current application user.
-
getExternalUserIds
public static java.util.List<ExternalUserId> getExternalUserIds()
Returns the List that hold External UserId parameters for the current application user- Returns:
- externalUserIds as Array.
-
setCustomHeaders
public static void setCustomHeaders(java.util.HashMap<java.lang.String,java.lang.String> customHeaders)
HashMap containing a list of custom headers to add to requests
-
getCustomHeaders
public static java.util.HashMap<java.lang.String,java.lang.String> getCustomHeaders()
Returns the HashMap containing a list of custom headers to add to requests- Returns:
- externalUserIds as Array.
-
initializeSdk
public static void initializeSdk(android.content.Context context, SdkInitializationListener listener)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).
-
getApplicationContext
@Deprecated public static android.content.Context getApplicationContext()
Deprecated.
-
setStoredAuctionResponse
public static void setStoredAuctionResponse(java.lang.String storedAuctionResponse)
-
getStoredAuctionResponse
public static java.lang.String getStoredAuctionResponse()
-
addStoredBidResponse
public static void addStoredBidResponse(java.lang.String bidder, java.lang.String responseId)
-
clearStoredBidResponses
public static void clearStoredBidResponses()
-
getStoredBidResponses
public static java.util.Map<java.lang.String,java.lang.String> 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
public static PrebidMobile.LogLevel getLogLevel()
-
setLogLevel
public static void setLogLevel(PrebidMobile.LogLevel logLevel)
-
getCustomLogger
public static LogUtil.PrebidLogger getCustomLogger()
-
setCustomLogger
public static void setCustomLogger(LogUtil.PrebidLogger logger)
-
checkGoogleMobileAdsCompatibility
public static void checkGoogleMobileAdsCompatibility(java.lang.String googleAdsVersion)
Check Google Mobile Ads compatibility for original API. Show logs if version is not compatible.- Parameters:
googleAdsVersion- - MobileAds.getVersion().toString()
-
setCustomStatusEndpoint
public static void setCustomStatusEndpoint(java.lang.String url)
Sets full valid URL for the /status endpoint of the PBS. Request to /status is sent when you callinitializeSdk(Context, SdkInitializationListener).- See Also:
- GET /status
-
getCustomStatusEndpoint
public static java.lang.String getCustomStatusEndpoint()
-
setIncludeWinnersFlag
public static void setIncludeWinnersFlag(boolean includeWinners)
-
getIncludeWinnersFlag
public static boolean getIncludeWinnersFlag()
-
setIncludeBidderKeysFlag
public static boolean setIncludeBidderKeysFlag(boolean includeBidderKeys)
-
getIncludeBidderKeysFlag
public static boolean getIncludeBidderKeysFlag()
-
getPbsConfig
public static PBSConfig getPbsConfig()
-
setPbsConfig
public static void setPbsConfig(PBSConfig pbsConfig)
-
getCreativeFactoryTimeout
public static int getCreativeFactoryTimeout()
Priority Policy: PBSConfig > SDKConfig > Default- Returns:
- creativeFactoryTimeout in ms
-
setCreativeFactoryTimeout
public static void setCreativeFactoryTimeout(int creativeFactoryTimeout)
-
getCreativeFactoryTimeoutPreRenderContent
public static int getCreativeFactoryTimeoutPreRenderContent()
Priority Policy: PBSConfig > SDKConfig > Default- Returns:
- creativeFactoryTimeoutPreRender in ms
-
setCreativeFactoryTimeoutPreRenderContent
public static void setCreativeFactoryTimeoutPreRenderContent(int creativeFactoryTimeoutPreRenderContent)
-
registerPluginRenderer
public static void registerPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer)
-
unregisterPluginRenderer
public static void unregisterPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer)
-
containsPluginRenderer
public static java.lang.Boolean containsPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer)
-
-