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
.
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 * |
A mandatory parameter that defines the application ID in the DT Console. |
completionBlock |
IASDKCoreInitBlock |
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 |
An optional queue specifying where the completionBlock invokes. |
API init Flag
You can verify the SDK initialization status using the initialised
property:
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.
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. |