📘

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 Config ID.
completionLRInitializeCompletion

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

syncFilters

🚧

This Method is Only Available in Closed Beta

ATS On-device is only available in closed beta and their methods will not work out-of-the-box.

If you want to be part of the closed beta release, contact your LiveRamp administrator to get ATS On-device enabled.

This method synchronizes the Bloom filter based on whether a configuration has changed and new Bloom filters are available to download. The result is LRSyncFiltersCompletion with LRBloomFilterSyncStatus which contains information if the synchronization was full, partial or if there was an error.

Parameters

NameTypeDescription
completionLRSyncFiltersCompletion

(LRBloomFilterSyncStatus)
The completion handler to call when the Bloom filter has completed synchronization.

Returns

No return parameter

getDealIDs

🚧

This Method is Only Available in Closed Beta

ATS On-device is only available in closed beta and their methods will not work out-of-the-box.

If you want to be part of the closed beta release, contact your LiveRamp administrator to get ATS On-device enabled.

Based on a user identifier, this method returns asynchronously-delivered LRGetDealIDsCompletion with LRDealIDsResult that contains result status (status: DealIDsResultStatus) which can be offline, partial or full and array of generated dealIDs (dealIds: [String]).

To retrieve a valid Deal IDs, 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.

Parameters

NameTypeDescription
userIdentifierLRDealIdentifierNon-hashed or SHA256-hashed email for which LRDealIDsResult is requested.
completionLRGetDealIDsCompletion

(LRDealIDsResult)
Completion handler to call when LRDealIDsResult is created.

Returns

No return parameter

getEnvelope

This method returns envelope for the specified identifier. Note that phone numbers must be normalized before passing to the SDK.

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 (tied to your placement) must first be approved by a LiveRamp representative.

Parameters

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

Phone numbers must be normalized before passing to the SDK. See Phone Number Normalizations.
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