Class OpenWrapSDK

  • All Implemented Interfaces:

    
    public class OpenWrapSDK
    
                        

    Provides global configurations for the OpenWrap SDK, e.g. enabling logging, location access, etc. These configurations are globally applicable for OpenWrap SDK; you don't have to set these for every ad request.

    • Constructor Detail

      • OpenWrapSDK

        OpenWrapSDK()
    • Method Detail

      • initialize

        @AnyThread() static void initialize(@NonNull() Context context, @NonNull() OpenWrapSDKConfig sdkConfig, @NonNull() OpenWrapSDKInitializer.Listener listener)

        Initializes the OpenWrap SDK with the provided configuration and context. This static method serves as a convenient entry point to initialize the OpenWrap SDK using the specified context and SDK configuration. Upon completion of the initialization process, the specified listener is notified of the outcome through its onSuccess or onFailure methods.

        Parameters:
        context - The context, used for SDK initialization.
        sdkConfig - The configuration settings for the OpenWrap SDK, including publisher ID and profile IDs.
        listener - An implementation of the OpenWrapSDKInitializer.Listener interface, which will be notified upon the success or failure of the SDK initialization.
      • getVersion

         static String getVersion()

        Returns the OpenWrap SDK's version.

        Returns:

        sdk version

      • allowLocationAccess

         static void allowLocationAccess(boolean allow)

        Used to enable/disable location access. This value decides whether the OpenWrap SDK should access device location using Core Location APIs to serve location-based ads. When set to false, the SDK will not attempt to access device location. When set to true, the SDK will periodically try to fetch location efficiently. Note that, this only occurs if location services are enabled and the user has already authorized the use of location services for the application. The OpenWrap SDK never asks permission to use location services by itself.

        The default value is true.

        Parameters:
        allow - enable or disable location access behavior
      • setUseInternalBrowser

         static void setUseInternalBrowser(boolean internalBrowserState)

        Tells OpenWrap SDK to use the internal SDK browser, instead of the default device browser, for opening landing pages when the user clicks on an ad. By default, the use of an internal browser is disabled.

        From version 2.7.0, the default behaviour changed to using device's default browser

        Parameters:
        internalBrowserState - boolean value that enables/disables the use of internal browser.
      • setLocation

         static void setLocation(POBLocation location)

        Sets user's location and its source. It is useful in delivering geographically relevant ads.

        If your application is already accessing the device location, it is highly recommended to set the location coordinates inferred from the device GPS. If you are inferring location from any other source, make sure you set the appropriate location source.

        Parameters:
        location - User's current location
      • setCoppa

         static void setCoppa(boolean coppaState)

        Indicates whether the visitor is COPPA-specific or not. For COPPA (Children's Online Privacy Protection Act) compliance, if the visitor's age is below 13, then such visitors should not be served targeted ads. Possible options are: false - Indicates that the visitor is not COPPA-specific and can be served targeted ads. true - Indicates that the visitor is COPPA-specific and should be served only COPPA-compliant ads.

        Parameters:
        coppaState - Visitor state for COPPA compliance.
      • setSSLEnabled

         static void setSSLEnabled(boolean requestSecureCreative)

        Enable/disable secure ad calls.

        By default, OpenWrap SDK initiates secure ad calls from an application to the ad server and delivers only secure ads. You can allow non secure ads by passing false to this method.

        Parameters:
        requestSecureCreative - false for disable secure creative mode.
      • allowAdvertisingId

         static void allowAdvertisingId(boolean allow)

        Indicates whether Android advertisement ID should be sent in the request or not. By default advertisement ID will be used.

        Possible values are: true : Advertisement id will be sent in the request. false : Advertisement id will not be sent in the request.

        Parameters:
        allow - state of advertisement id usage
      • setApplicationInfo

         static void setApplicationInfo(POBApplicationInfo applicationInfo)

        Sets Application information, which contains various attributes about app, such as application category, store URL, domain, etc for more relevant ads.

        Parameters:
        applicationInfo - Instance of POBApplicationInfo class with required application details
      • setUserInfo

         static void setUserInfo(POBUserInfo userInfo)

        Sets user information, such as birth year, gender, region, etc for more relevant ads.

        Parameters:
        userInfo - Instance of POBUserInfo class with required user details
      • addExternalUserId

         static void addExternalUserId(@NonNull() POBExternalUserId userId)

        API to Add the External user id /Data Partner ids which helps publisher in better user targeting

        Parameters:
        userId - instance of POBExternalUserId class
      • removeExternalUserIds

         static void removeExternalUserIds(@NonNull() String source)

        API to remove the external user ids of a particular source

        Parameters:
        source - name of source