OpenWrapSDK Class Reference

Inherits from NSObject
Declared in OpenWrapSDK.h

Overview

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.

Instance Methods

+ initializeWithConfig:andCompletionHandler:

Initializes the OpenWrap SDK with SDK config and completion handler

+ (void)initializeWithConfig:(OpenWrapSDKConfig *)config andCompletionHandler:(OpenWrapSDKInitCompletionBlock)completionHandler

Parameters

config

configurations to initialize sdk

completionHandler

Completion handler to be called after initializing SDK

Declared In

OpenWrapSDK.h

+ version

Returns the OpenWrap SDK’s version.

+ (NSString *)version

Declared In

OpenWrapSDK.h

+ setLogLevel:

Sets log level across all ad formats. Default log level is POBSDKLogLevelWarn

+ (void)setLogLevel:(POBSDKLogLevel)logLevel

Parameters

logLevel

log level to set.

See Also

Declared In

OpenWrapSDK.h

+ allowLocationAccess:

Used to enable/disable location access.

+ (void)allowLocationAccess:(BOOL)allow

Parameters

allow

YES/NO value

Discussion

This value decides whether the OpenWrap SDK should access device location using Core Location APIs to serve location-based ads. When set to NO, the SDK will not attempt to access device location. When set to YES, 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 YES.

Declared In

OpenWrapSDK.h

+ useInternalBrowser:

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.

@note From version 2.7.0, the default behaviour changed to using device’s default browser

+ (void)useInternalBrowser:(BOOL)use

Parameters

use

BOOL value that enables/disables the use of internal browser.

Declared In

OpenWrapSDK.h

+ setLocation:source:

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

+ (void)setLocation:(CLLocation *)location source:(POBLocSource)source

Parameters

location

User’s current location

source

Source of user’s location.

See Also

Declared In

OpenWrapSDK.h

+ setCoppaEnabled:

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.

+ (void)setCoppaEnabled:(BOOL)enable

Parameters

enable

boolean value

  • No : Indicates that the visitor is not COPPA-specific and can be served targeted ads.
  • Yes : Indicates that the visitor is COPPA-specific and should be served only COPPA-compliant ads.

Declared In

OpenWrapSDK.h

+ setSSLEnabled:

Enable/disable secure ad calls.

+ (void)setSSLEnabled:(BOOL)enable

Parameters

enable

boolean value

Discussion

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 NO to this method.

Declared In

OpenWrapSDK.h

+ allowAdvertisingId:

Indicates whether Advertisement ID(IDFA) should be sent in the request.

+ (void)allowAdvertisingId:(BOOL)allow

Parameters

allow

boolean value

  • YES : Advertising Identifier will be sent in the request.
  • NO : Advertising Identifier will be masked in the request.

Declared In

OpenWrapSDK.h

+ allowAVAudioSessionAccess:

Indicates whether the OW SDK is allowed to access the shared AVAudioSession

+ (void)allowAVAudioSessionAccess:(BOOL)allow

Parameters

allow

boolean value

  • YES(Default) : SDK may access the shared AVAudioSession
  • NO : SDK should not access the shared AVAudioSession

Discussion

Note: This method disables the audio session access only for OpenWrap SDK. You may have to use a similar provision from ad server sdk, if available, to restrict it from potentially interfering with your app’s audio.

Declared In

OpenWrapSDK.h

+ setApplicationInfo:

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

+ (void)setApplicationInfo:(POBApplicationInfo *)appInfo

Parameters

appInfo

POBApplicationInfo object having application information

Declared In

OpenWrapSDK.h

  applicationInfo

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

@property (class, nonatomic, readonly) POBApplicationInfo *applicationInfo

Declared In

OpenWrapSDK.h

+ setUserInfo:

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

+ (void)setUserInfo:(POBUserInfo *)userInfo

Parameters

userInfo

User object having user related information

See Also

Declared In

OpenWrapSDK.h

  userInfo

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

@property (class, nonatomic, readonly) POBUserInfo *userInfo

See Also

Declared In

OpenWrapSDK.h

+ addExternalUserId:

Add user’s raw/hashed data required by identity partners which will be passed in the ad request.

+ (void)addExternalUserId:(POBExternalUserId *)externalUserId

Parameters

externalUserId

Instance of POBExternalUserId storing user’s data received from identity vendors.

Discussion

Usually the application fetches the user ids from identity vendors and it should be passed to OpenWrap SDK using this API.

This external user id passed to OpenWrap SDK will persist for an app session only.

Declared In

OpenWrapSDK.h

+ externalUserIds

API to get all the added user Ids in OpenWrap SDK using API addExternalUserId.

+ (NSArray<POBExternalUserId*> *)externalUserIds

Return Value

List of all the POBExternalUserId

Declared In

OpenWrapSDK.h

+ removeExternalUserIdsWithSource:

API to remove the external user id containing user’s data received from identity partners, passed to OpenWrap SDK using addExternalUserId.

+ (void)removeExternalUserIdsWithSource:(NSString *)source

Parameters

source

Source of the user id to which is to be removed.

Declared In

OpenWrapSDK.h

+ removeAllExternalUserIds

API to remove all the external user ids containing user’s data received from identity partners, passed to OpenWrap SDK using addExternalUserId.

+ (void)removeAllExternalUserIds

Declared In

OpenWrapSDK.h

  dsaComplianceStatus

A property to get the current DSA (Digital Services Act) compliance status. Default value is @c POBDSAComplianceStatusNotRequired.

@property (nonatomic, class, readonly) POBDSAComplianceStatus dsaComplianceStatus

Discussion

A property to get the current DSA (Digital Services Act) compliance status. Default value is @c POBDSAComplianceStatusNotRequired.

Declared In

OpenWrapSDK.h

+ setDSAComplianceStatus:

Sets the DSA (Digital Services Act) compliance status.

+ (void)setDSAComplianceStatus:(POBDSAComplianceStatus)status

Parameters

status

The DSA compliance status to be set. See @c POBDSAComplianceStatus for supported values.

Discussion

Sets the DSA (Digital Services Act) compliance status.

Declared In

OpenWrapSDK.h