3. Call the APIs
This page guides you through the Mobile SDK APIs you can utilize to help you retrieve envelopes more efficiently.
You can also check the envelope settings in Console to see the refresh time, enable logging mode, and others. See our Console documentation on Implementing ATS Mobile SDK to learn more.
Need help with ATS Mobile SDK? Contact [email protected] to talk to a LiveRamp representative.
Methods
getEnvelope
This method returns an envelope for the specified identifier. Phone numbers as identifiers are only supported in the U.S. and they need to be normalized before passing to the SDK.
To retrieve a valid envelope, your ATS placement must already be approved. 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.
LRCustomIdentifier not available for all publishers
Due to the complexity of the custom ID mapping process, LRCustomIdentifier is only available for selected publishers who must go through an extensive onboarding process. Please note that you cannot use this API out-of-the-box.
Parameters
Name | Type | Description |
---|---|---|
id | LREmailIdentifier LREmailIdentifier(email: String) LREmailIdentifier(sha1: String?, sha256: String?, md5: String?) LRPhoneIdentifier (U.S. only) LRPhoneIdentifier(phoneNumber: String) LRPhoneIdentifier(sha1: String) LRCustomIdentifier (Not available for all publishers) LRCustomIdentifier(customId: String) | Non-hashed or hashed identifier for which you are requesting envelope. Phone numbers must be normalized before passing to the SDK. See Phone Number Normalizations. |
callback | LREnvelopeCallback fun invoke(envelope: Envelope?, error: LRError?) | Instance of a callback which returns the result. |
Returns
No return parameter
Example
LRAtsManager.getEnvelope(
LREmailIdentifier("[email protected]"),
object : LREnvelopeCallback {
override fun invoke(envelope: Envelope?, error: LRError?) {
logD("getEnvelopeAPI: ${envelope?.envelope}")
}
})
LRAtsManager.INSTANCE.getEnvelope(new LREmailIdentifier("[email protected]"), new LREnvelopeCallback() {
@Override
public void invoke(@Nullable Envelope envelope, @Nullable LRError lrError) {
Log.d("Here's your envelope! ", envelope.getEnvelope());
}
});
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.
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.
This method returns a list of Deal IDs and Deal ID status for the specified email. To retrieve valid Deal IDs, your ATS placement must already be approved. 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.
An Integration Key generated in Console is required to retrieve a Deal ID for active deals.
Parameters
Name | Type | Description |
---|---|---|
id | LRDealIdentifier LRDealIdentifier(email: String) LRDealIdentifier(sha256: String) | Non-hashed or SHA256-hashed email for which you are requesting a list of Deal IDs. |
callback | LRDealIDCallback fun invoke(dealIDResult: DealIDResult?, error: LRError?) | Instance of callback which returns the result. |
Returns
No return parameter
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 starts the synchronization process of the library and updates the data used for generating Deal IDs.
Parameters
Name | Type | Description |
---|---|---|
callback | LRBloomFilterSyncCallback fun invoke(status: BloomFilterSyncStatus?, error: LRError?) | instance of callback which returns the result. |
Returns
No return parameter
setHasConsentForNoLegislation
This method allows you to set consent flags for countries outside of EU and U.S. that are configured in Console.
Parameter
Name | Type | Description |
---|---|---|
hasConsentForNoLegislation | Boolean | Edit consent if the country is not subject to GDPR/CCPA. |
Returns
No return parameter
hasConsentForNoLegislation
This method returns a consent flag for countries outside of the U.S. and EU that are configured in Console for the ATS placement. If the value is true
, SDK will proceed without checking for consent.
The default value is false
.
To set the value to true
, refer to setHasConsentForNoLegislation.
Parameter
No parameter
Returns
Boolean
getSdkStatus
This method returns the current SDK state.
Returns
SDK status.
isDisabled
This property is used to control the status of the SDK. When set to true
, the SDK becomes disabled. As a result, the APIs will not function and API calls will not be possible. Setting the property to false
changes the SDK status to notInitialized
and re-initialization is required before API calls can be made again.
The default value is false
.
Parameter
Name | Type | Description |
---|---|---|
sdkDisable | Boolean | Flag used for disabling or enabling SDK. |
Returns
No return parameter
setAtsManagerCallback
This method sets callback for ATS Manager that is used for receiving events.
Parameter
Name | Type | Description |
---|---|---|
eventsCallback | LRAtsManagerCallback | The instance of callback used for event delegation. |
Returns
No return parameter.
removeAtsManagerCallback
This method removes callback for ATS Manager that is used for receiving events.
Parameters
No parameter
Returns
No return parameter
resetSdk
This method resets SDK to its initial state.
Parameters
No parameter
Returns
No return parameter
getSdkVersion
This method returns current version of the SDK.
Parameter
No parameter
Returns
String
Classes
LRAtsConfiguration
This class is used to configure LRAts SDK during initialization.
Property Name | Type | Default | Description |
---|---|---|---|
configurationId | String | / | Configuration ID obtained from LiveRamp Console. |
isTestMode | Boolean | false | If set to true , test mode will be enabled, in which test data is returned instead of real data from the backend. See Test Mode for more information. |
logToFileEnabled | Boolean | false | If set to true , all log levels will be logged to the file in /files /logs directory in the app's sandbox. |
apiKey | String | null | Refers to Integration Key generated through Console which is required to enable ATS On-Device. |
Updated about 2 months ago