Package com.adcolony.sdk
Class AdColonyAppOptions
- java.lang.Object
-
- com.adcolony.sdk.AdColonyAppOptions
-
public class AdColonyAppOptions extends java.lang.ObjectApp specific options to be created, set, and passed when configuring AdColony. Includes data used for server side reward validation, such as the user ID, and user metadata that may improve our ad targeting.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADMARVELstatic java.lang.StringADMOBstatic java.lang.StringADOBEAIRstatic java.lang.StringAERSERVEstatic intALLDeprecated.static java.lang.StringAPPODEALstatic java.lang.StringCCPAstatic java.lang.StringCOCOS2DXstatic java.lang.StringCOPPAstatic java.lang.StringCORONAstatic java.lang.StringFUSEPOWEREDstatic java.lang.StringFYBERstatic java.lang.StringGDPRstatic java.lang.StringIRONSOURCEstatic intLANDSCAPEDeprecated.static java.lang.StringMOPUBstatic intPORTRAITDeprecated.static intSENSORDeprecated.static java.lang.StringUNITY
-
Constructor Summary
Constructors Constructor Description AdColonyAppOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetAppOrientation()Used to retrieve the app orientation set in the app options.java.lang.StringgetAppVersion()Used to retrieve the app version set in the app options.java.lang.StringgetGDPRConsentString()Deprecated.booleangetGDPRRequired()Deprecated.booleangetIsChildDirectedApp()Used to retrieve value of isChildDirectedbooleangetKeepScreenOn()Used to retrieve the current setting for keepScreenOn.JSONObjectgetMediationInfo()Used to retrieve the currently set mediation info.static AdColonyAppOptionsgetMoPubAppOptions(java.lang.String clientOptions)Used to return app options when configuring the origin store and app version via MoPub's dashboardbooleangetMultiWindowEnabled()Used to retrieve the multi-window enabled flagjava.lang.ObjectgetOption(java.lang.String key)Used to retrieve an arbitrary option with the given key.java.lang.StringgetOriginStore()Used to retrieve the origin store set in the app options.JSONObjectgetPluginInfo()Used to retrieve the currently set plugin info.java.lang.StringgetPrivacyConsentString(java.lang.String type)Used to retrieve the specified privacy consent string set in the app options.booleangetPrivacyFrameworkRequired(java.lang.String type)Used to retrieve the specified privacy framework required value set in the app options.intgetRequestedAdOrientation()Deprecated.booleangetTestModeEnabled()Used to retrieve the test mode enabled flagjava.lang.StringgetUserID()Used to retrieve the unique user id set in the app options.AdColonyUserMetadatagetUserMetadata()Deprecated.booleanisPrivacyFrameworkRequiredSet(java.lang.String type)Used to check whenever privacyFrameworkRequired value was set for specified frameworkAdColonyAppOptionssetAppOrientation(int orientation)Optionally send a constant representing the orientation of your app.AdColonyAppOptionssetAppVersion(java.lang.String app_version)Optionally set an app version to be reported to AdColony.AdColonyAppOptionssetGDPRConsentString(java.lang.String consentString)Deprecated.AdColonyAppOptionssetGDPRRequired(boolean required)Deprecated.AdColonyAppOptionssetIsChildDirectedApp(boolean isChildDirectedApp)When set to true SDK will not transmit any identifiers to the servers unless user is explicitly set as non-child via COPPA flagAdColonyAppOptionssetKeepScreenOn(boolean keepScreenOn)Used to programmatically set a flag on our Activity's window to keep the display from going to sleep.AdColonyAppOptionssetMediationNetwork(java.lang.String name, java.lang.String version)Used to send information about the mediation network that has implemented AdColonyAdColonyAppOptionssetMultiWindowEnabled(boolean enabled)Used to alert AdColony that multi-window is enabled for your app, allowing us to adjust our interstitial layout as necessary.AdColonyAppOptionssetOption(java.lang.String key, boolean value)Optionally set an arbitrary key/value definitionAdColonyAppOptionssetOption(java.lang.String key, double value)Optionally set an arbitrary key/value definitionAdColonyAppOptionssetOption(java.lang.String key, java.lang.String value)Optionally set an arbitrary key/value definitionAdColonyAppOptionssetOriginStore(java.lang.String origin_store)Optionally set the origin store for this app (default: 'google').AdColonyAppOptionssetPlugin(java.lang.String name, java.lang.String version)Used to send information about the plugin AdColony wrapper.AdColonyAppOptionssetPrivacyConsentString(java.lang.String type, java.lang.String consentString)This is to provide AdColony with the user's consent string of the specified type if applicable.AdColonyAppOptionssetPrivacyFrameworkRequired(java.lang.String type, boolean required)This is to provide AdColony about whether or not the specified privacy framework is applicable.AdColonyAppOptionssetRequestedAdOrientation(int orientation)Deprecated.AdColonyAppOptionssetTestModeEnabled(boolean enabled)Used to enable test ads for your application without changing dashboard settings.AdColonyAppOptionssetUserID(java.lang.String user_id)Optionally set a unique id for this specific app session to be reported to AdColony.AdColonyAppOptionssetUserMetadata(AdColonyUserMetadata metadata)Deprecated.
-
-
-
Field Detail
-
ADMOB
public static final java.lang.String ADMOB
- See Also:
- Constant Field Values
-
MOPUB
public static final java.lang.String MOPUB
- See Also:
- Constant Field Values
-
IRONSOURCE
public static final java.lang.String IRONSOURCE
- See Also:
- Constant Field Values
-
APPODEAL
public static final java.lang.String APPODEAL
- See Also:
- Constant Field Values
-
FUSEPOWERED
public static final java.lang.String FUSEPOWERED
- See Also:
- Constant Field Values
-
AERSERVE
public static final java.lang.String AERSERVE
- See Also:
- Constant Field Values
-
ADMARVEL
public static final java.lang.String ADMARVEL
- See Also:
- Constant Field Values
-
FYBER
public static final java.lang.String FYBER
- See Also:
- Constant Field Values
-
UNITY
public static final java.lang.String UNITY
- See Also:
- Constant Field Values
-
ADOBEAIR
public static final java.lang.String ADOBEAIR
- See Also:
- Constant Field Values
-
COCOS2DX
public static final java.lang.String COCOS2DX
- See Also:
- Constant Field Values
-
CORONA
public static final java.lang.String CORONA
- See Also:
- Constant Field Values
-
CCPA
public static final java.lang.String CCPA
- See Also:
- Constant Field Values
-
GDPR
public static final java.lang.String GDPR
- See Also:
- Constant Field Values
-
COPPA
public static final java.lang.String COPPA
- See Also:
- Constant Field Values
-
SENSOR
@Deprecated public static final int SENSOR
Deprecated.- See Also:
- Constant Field Values
-
PORTRAIT
@Deprecated public static final int PORTRAIT
Deprecated.- See Also:
- Constant Field Values
-
LANDSCAPE
@Deprecated public static final int LANDSCAPE
Deprecated.- See Also:
- Constant Field Values
-
ALL
@Deprecated public static final int ALL
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
setPrivacyConsentString
public AdColonyAppOptions setPrivacyConsentString(java.lang.String type, java.lang.String consentString)
This is to provide AdColony with the user's consent string of the specified type if applicable.- Parameters:
type- one of the applicable constants defined in this class: "GDPR" or "CCPA".consentString- the user's consent string of the specified type. For GDPR, this should either be "0" or "1" (representing do not consent, or consent), or the IAB standard consent String. For CCPA, this should either be a "0", or "1" (representing do not sell = true, or do not sell = false), or the IAB standard consent String.- Returns:
- 'this' for chaining calls.
-
setPrivacyFrameworkRequired
public AdColonyAppOptions setPrivacyFrameworkRequired(java.lang.String type, boolean required)
This is to provide AdColony about whether or not the specified privacy framework is applicable.
-
getPrivacyConsentString
public java.lang.String getPrivacyConsentString(java.lang.String type)
Used to retrieve the specified privacy consent string set in the app options.
-
getPrivacyFrameworkRequired
public boolean getPrivacyFrameworkRequired(java.lang.String type)
Used to retrieve the specified privacy framework required value set in the app options.
-
isPrivacyFrameworkRequiredSet
public boolean isPrivacyFrameworkRequiredSet(java.lang.String type)
Used to check whenever privacyFrameworkRequired value was set for specified framework
-
setIsChildDirectedApp
public AdColonyAppOptions setIsChildDirectedApp(boolean isChildDirectedApp)
When set to true SDK will not transmit any identifiers to the servers unless user is explicitly set as non-child via COPPA flag- Parameters:
isChildDirectedApp- whether the application is directed towards children- Returns:
- 'this' for chaining calls.
-
getIsChildDirectedApp
public boolean getIsChildDirectedApp()
Used to retrieve value of isChildDirected- Returns:
- value of isChildDirectedApp, or false if it has not been set
-
setGDPRRequired
@Deprecated public AdColonyAppOptions setGDPRRequired(boolean required)
Deprecated.This is to inform the AdColony service if GDPR should be considered for the user based on if they are EU citizens or from EU territories.- Parameters:
required- whether or not we need consider GDPR for this user.- Returns:
- 'this' for chaining calls.
- See Also:
- AdColony GDPR FAQ
-
getGDPRRequired
@Deprecated public boolean getGDPRRequired()
Deprecated.Used to retrieve the GDPR required key set in the app options.- Returns:
- the value for GDPR required that has been set, or false if it has not been set.
-
setGDPRConsentString
@Deprecated public AdColonyAppOptions setGDPRConsentString(java.lang.String consentString)
Deprecated.Optionally set the user's GDPR consent String. The IAB Europe Transparency and Consent framework defines standard APIs and formats for communicating between Consent Management Platforms (CMPs) collecting consents from end users and vendors embedded on a website or in a mobile application. It provides a unified interface for a seamless integration where CMPs and vendors do not have to integrate manually with hundreds of partners. This is for GDPR compliance through IAB.- Parameters:
consentString- the user's GDPR consent String.- Returns:
- 'this' for chaining calls.
- See Also:
- AdColony GDPR FAQ, IAB GDPR Documentation
-
getGDPRConsentString
@Deprecated public java.lang.String getGDPRConsentString()
Deprecated.Used to retrieve the GDPR consent String set in the app options.- Returns:
- the value for the GDPR consent String that has been set, or an empty String if it has not been set.
-
setAppVersion
public AdColonyAppOptions setAppVersion(java.lang.String app_version)
Optionally set an app version to be reported to AdColony.- Parameters:
app_version- the version of your app.- Returns:
- 'this' for chaining calls.
-
getAppVersion
public java.lang.String getAppVersion()
Used to retrieve the app version set in the app options.- Returns:
- the app version that has been set, or an empty String if no app version has been set.
-
setUserID
public AdColonyAppOptions setUserID(java.lang.String user_id)
Optionally set a unique id for this specific app session to be reported to AdColony.- Parameters:
user_id- the unique id for this user.- Returns:
- 'this' for chaining calls.
-
getUserID
public java.lang.String getUserID()
Used to retrieve the unique user id set in the app options.- Returns:
- the user id, or an empty String if it has not been set.
-
setOption
public AdColonyAppOptions setOption(java.lang.String key, boolean value)
Optionally set an arbitrary key/value definition- Parameters:
key- the key for this option mapping.value- the value for this option mapping.- Returns:
- 'this' for chaining calls.
-
getOption
public java.lang.Object getOption(java.lang.String key)
Used to retrieve an arbitrary option with the given key.- Parameters:
key- the key of the option you wish to retrieve.- Returns:
- the value mapped to the provided key, or false if the mapping does not exist.
-
setOption
public AdColonyAppOptions setOption(java.lang.String key, double value)
Optionally set an arbitrary key/value definition- Parameters:
key- the key for this option mapping.value- the value for this option mapping.- Returns:
- 'this' for chaining calls.
-
setOption
public AdColonyAppOptions setOption(java.lang.String key, java.lang.String value)
Optionally set an arbitrary key/value definition- Parameters:
key- the key for ths option mapping.value- the value for this option mapping.- Returns:
- 'this' for chaining calls.
-
setOriginStore
public AdColonyAppOptions setOriginStore(java.lang.String origin_store)
Optionally set the origin store for this app (default: 'google').- Parameters:
origin_store- the origin store for this device.- Returns:
- 'this' for chaining calls.
-
getOriginStore
public java.lang.String getOriginStore()
Used to retrieve the origin store set in the app options.- Returns:
- the origin store, "google" by default.
-
setRequestedAdOrientation
@Deprecated public AdColonyAppOptions setRequestedAdOrientation(int orientation)
Deprecated.Optionally send a requested orientation for interstitials to be displayed in.- Parameters:
orientation- one of the orientation constants defined in this class.- Returns:
- 'this' for chaining calls.
-
getRequestedAdOrientation
@Deprecated public int getRequestedAdOrientation()
Deprecated.Used to retrieve the orientation set in the app options.- Returns:
- the orientation that has been set, or -1 if it has not been set.
-
setAppOrientation
public AdColonyAppOptions setAppOrientation(int orientation)
Optionally send a constant representing the orientation of your app.- Parameters:
orientation- one of the orientation constants defined in this class.- Returns:
- 'this' for chaining calls.
-
getAppOrientation
public int getAppOrientation()
Used to retrieve the app orientation set in the app options.- Returns:
- the orientation that has been set, or -1 if it has not been set.
-
setUserMetadata
@Deprecated public AdColonyAppOptions setUserMetadata(AdColonyUserMetadata metadata)
Deprecated.Used to send AdColony extra information about this user.- Parameters:
metadata- the AdColonyUserMetadata object to send.- Returns:
- 'this' for chaining calls.
- See Also:
AdColonyUserMetadata
-
setTestModeEnabled
public AdColonyAppOptions setTestModeEnabled(boolean enabled)
Used to enable test ads for your application without changing dashboard settings.- Parameters:
enabled- represents whether or not to enable test ads for your application.- Returns:
- 'this' for chaining calls.
-
getTestModeEnabled
public boolean getTestModeEnabled()
Used to retrieve the test mode enabled flag- Returns:
- whether or not test mode has been enabled in the app options.
-
setMultiWindowEnabled
public AdColonyAppOptions setMultiWindowEnabled(boolean enabled)
Used to alert AdColony that multi-window is enabled for your app, allowing us to adjust our interstitial layout as necessary.- Parameters:
enabled- represents whether or not multi window is enabled for your app.- Returns:
- 'this' for chaining calls.
-
getMultiWindowEnabled
public boolean getMultiWindowEnabled()
Used to retrieve the multi-window enabled flag- Returns:
- whether or not multi-window has been enabled in the app options.
-
getUserMetadata
@Deprecated public AdColonyUserMetadata getUserMetadata()
Deprecated.Used to retrieve the currently set user metadata.- Returns:
- the currently set AdColonyUserMetadata object. Will return null if it has not been set.
- See Also:
AdColonyUserMetadata
-
setMediationNetwork
public AdColonyAppOptions setMediationNetwork(java.lang.String name, java.lang.String version)
Used to send information about the mediation network that has implemented AdColony- Parameters:
name- the name of the networkversion- the version of the adapter- Returns:
- 'this' for chaining calls.
-
getMediationInfo
public JSONObject getMediationInfo()
Used to retrieve the currently set mediation info.- Returns:
- a JSON object with keys 'name' and 'version' representing what was set via
setMediationNetwork(String, String). Will be mapped to empty Strings if this option has not been set.
-
setPlugin
public AdColonyAppOptions setPlugin(java.lang.String name, java.lang.String version)
Used to send information about the plugin AdColony wrapper.- Parameters:
name- the name of the pluginversion- the version of the plugin wrapper- Returns:
- 'this' for chaining calls.
-
getPluginInfo
public JSONObject getPluginInfo()
Used to retrieve the currently set plugin info.- Returns:
- a JSON object with keys 'name' and 'version' representing what was set via
setPlugin(String, String). Will be mapped to empty Strings if this option has not been set.
-
setKeepScreenOn
public AdColonyAppOptions setKeepScreenOn(boolean keepScreenOn)
Used to programmatically set a flag on our Activity's window to keep the display from going to sleep.- Parameters:
keepScreenOn- whether or not to keep the screen on- Returns:
- 'this' for chaining calls.
-
getKeepScreenOn
public boolean getKeepScreenOn()
Used to retrieve the current setting for keepScreenOn.- Returns:
- the current setting for keepScreenOn.
-
getMoPubAppOptions
public static AdColonyAppOptions getMoPubAppOptions(java.lang.String clientOptions)
Used to return app options when configuring the origin store and app version via MoPub's dashboard- Returns:
- AdColonyAppOptions that were configured with the parameters on MoPub's dashboard or null if the options are invalid
- See Also:
AdColonyAppOptions
-
-