Class AdColonyAppOptions


  • public class AdColonyAppOptions
    extends java.lang.Object
    App 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.
    • Constructor Detail

      • AdColonyAppOptions

        public AdColonyAppOptions()
    • 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.
        Parameters:
        type - one of the applicable constants defined in this class: "GDPR", "CCPA", or "COPPA".
        required - whether or not the specified law should be considered applicable for this user.
        Returns:
        'this' for chaining calls.
      • getPrivacyConsentString

        public java.lang.String getPrivacyConsentString​(java.lang.String type)
        Used to retrieve the specified privacy consent string set in the app options.
        Parameters:
        type - one of the constants defined in this class "GDPR" or "CCPA".
        Returns:
        the value for the specified consent string or an empty string if it has not been set.
      • getPrivacyFrameworkRequired

        public boolean getPrivacyFrameworkRequired​(java.lang.String type)
        Used to retrieve the specified privacy framework required value set in the app options.
        Parameters:
        type - one of the constants defined in this class "GDPR", "CCPA", or "COPPA".
        Returns:
        the value for the specified privacy framework required boolean or false if it has not been set.
      • isPrivacyFrameworkRequiredSet

        public boolean isPrivacyFrameworkRequiredSet​(java.lang.String type)
        Used to check whenever privacyFrameworkRequired value was set for specified framework
        Parameters:
        type - one of the constants defined in this class "GDPR", "CCPA", or "COPPA".
        Returns:
        true if value for specified framework set, false otherwise
      • 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 network
        version - 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 plugin
        version - 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