📘

Each method with a callback has async / await counterpart that can be used 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

Name

Type

Description

configuration

LRAtsConfiguration

The object that contains an app ID and fallback configuration.

completion

LRAtsCompletionHandler

(success: Bool, error: Error?)

Completion handler to call when initialization process is finished.

getEnvelope

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

🚧

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

Parameters

Name

Type

Description

lrIdentifierData

Choose one of the following (do not use LRIdentifierData directly):
LREmailIdentifier
LRPhoneIdentifier (U.S. only)
LRCustomerIdentifier

Non-hashed or hashed identifier for which the envelope is requested.

callback

LREnvelopeCallback

(envelope: LREnvelope?, error: LRError?)

Instance of a callback which returns the result.

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)")
}

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