SDK Initialization for DT Exchange SDK

This guide explains how to configure advanced settings and initialize the DT Exchange SDK in your iOS application to ensure ad delivery and access to all SDK features. 

API init Method

To initialize the SDK, use the initWithAppID: method with your AppID.

Objective-C
 IASDKCore
  - (void)initWithAppID:(NSString * _Nonnull)appID
      completionBlock:(IASDKCoreInitBlock _Nullable)completionBlock
      completionQueue:(dispatch_queue_t _Nullable)completionQueue;

The following table describes the parameters for the initWithAppID: method.

PARAMETER PARAMETER TYPE DESCRIPTION
initWithAppID NSString *
_Nonnull
A mandatory parameter that defines the application ID in the DT Console.
completionBlock IASDKCoreInitBlock 
_Nullable
An optional block that executes when SDK initialization is complete. It provides a BOOL success flag and an optional NSError object if the initialization fails.
completionQueue dispatch_queue_t
_Nullable
An optional queue specifying where the completionBlock invokes.

API init Flag

You can verify the SDK initialization status using the initialised property:

Objective-C
  IASDKCore
  @property (atomic, readonly, getter=isInitialised) BOOL initialised;

This property returns YES if the SDK initialization is successful.

Callback Completion Error Codes

If an error occurs, NSSError returns one of the following error codes.

Objective-C
    IASDKCore
    typedef NS_ENUM(NSInteger, IASDKCoreInitErrorType) {
    IASDKCoreInitErrorTypeUnknown = 0,
    IASDKCoreInitErrorTypeFailedToDownloadMandatoryData = 1,
    IASDKCoreInitErrorTypeInvalidAppID = 3,
    IASDKCoreInitErrorTypeCancelled = 4
};

The following table describes the Callback Completion Error Codes.

ERROR CODE DESCRIPTION
IASDKCoreInitErrorTypeUnknown An unknown error occurred.
IASDKCoreInitErrorTypeFailedToDownloadMandatoryData Mandatory data download failed.
ASDKCoreInitErrorTypeInvalidAppID The provided AppID is invalid.
IASDKCoreInitErrorTypeCancelled The initialization process was canceled or restarted.

Back to Top ⇧