Methods
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
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 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
Name | Type | Description |
---|---|---|
lrIdentifierData | Choose 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. For email hashes, make sure the emails are completely in lowercase prior to hashing to ensure best possible match. |
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
Updated 7 days ago