📘

Each method with a callback has async / await counterpart which is available for iOS 15 and above.

initialize

To use the ATS SDK, the initialization method needs to be called to start initialization process. For more information, see initialize the iOS SDK.

Parameters

NameTypeDescription
configurationLRAtsConfigurationThe object that contains an app ID.
completionLRInitializeCompletion

(success: Bool, error: Error?)
Completion handler to call when initialization process is finished.

getEnvelope

This method returns envelope for the specified identifier. Phone numbers as identifiers are only supported in the U.S.

To retrieve a valid envelope, your ATS placement must be in an approved state. If the placement is unapproved, the SDK will return fake data which should only be used for testing. Information regarding the placement status can be found in the log output of the SDK.

🚧

To retrieve envelopes, the bundle ID of your application must first be approved by a LiveRamp representative.

Parameters

NameTypeDescription
lrIdentifierDataChoose one of the following (do not use LRIdentifierData directly):
LREmailIdentifier
LRPhoneIdentifier (U.S. only)
LRCustomIdentifier
Non-hashed or hashed identifier for which the envelope is requested.
completionLRGetEnvelopeCompletion

(_ envelope: LREnvelope?, _ error: LRError?)
Completion handler to call when the envelope has been retrieved.

Returns
No return parameter

See the following examples:

let lrEmailIdentifier = LREmailIdentifier("[email protected]")
LRAts.shared.getEnvelope(lrEmailIdentifier) { result, error in
    guard let envelope = result?.envelope else {
        print("Couldn't retrieve envelope. Error: \(error)")
        return
    }
    print("Received envelope: \(envelope)")
}
do {
    let lrEmailIdentifier = LREmailIdentifier("[email protected]")
    let envelope = try await LRAts.shared.getEnvelope(lrEmailIdentifier)
    print("Received envelope: \(envelope)")
} catch {
    print("Couldn't retrieve envelope. Error: \(error)")
}

📘

You can verify if an envelope has been successfully fetched by using a network HTTP proxy tool (such as Charles), and filter for the api.rlcdn call.

resetSDK

Calling this method will remove all data related to LRAtsSDK. To use the SDK after calling this method, you have to go through the initialization process again.

Parameters
No parameters

Returns
No return parameter