iOS Methods for LRAtsMediationAdapter
View all available methods and properties for iOS when implementing LRAtsMediationAdapter
This article lists all the methods and properties available with LRAtsMediationAdapter for iOS. LRAtsMediationAdapter facilitates data exchange between the Google AdMob and LRAtsSDKby allowing AdMob SDK to collect signals from LRAtsSDK.
To learn how to implement LRAtsMediationAdapter with Google Secure Signals, see "Generate and Pass Identity Envelopes with Google Secure Signals Adapter".
For SDK v3.0.0 and Above
If you are running the ATS Mobile SDK v3.0.0 and later, you don't need to perform any of the instructions and methods in this article. All required configurations to pass Google envelopes are set up out-of-the-box in these SDK versions.
Initialize the LRAtsSDK as feasibly as possible, and retrieve an envelope by calling getEnvelope. An identity envelope will automatically be included in your ad requests if LiveRamp is enabled as a secure signals partner. See the prerequisites to learn more.
To check which SDK version you are running, call sdkVersion.
Installation
To install with Swift Package Manager:
- in Xcode, go to File > Add packages.
- In Search or Enter Package URL, enter:
https://github.com/LiveRamp/ats-sdk-ios-google-adapter - Click Add Package.
To install with CocoaPods:
- Add the following line to your Podfile:
pod 'LRAtsSDKMediationAdapter' - Open Terminal and go to the directory where
Podfileis located. - Execute
pod installto install theLRAtsSDKMediationAdapter. - In Xcode, go to your project's build settings and add the
-ObjClinker flag to the Other Linker Flags build setting (AKAOTHER_LDFLAGS). This ensures that all Objective-C categories and class extensions are property linked.
Usage
Not Applicable for v3.0.0
This instruction is only applicable for iOS SDK v2.9.0 and below.
View how LRAtsMediationAdapter should be called below. If your ATS placement is enabled for Google SSP and Google envelope is detected, the collect signal call returns a Google-permissioned envelope. If not, it will return an ATS envelope
import LRAtsSDKMediationAdapter
LRAtsMediationAdapter.setIdentifier(LREmailIdentifier(email: "<#email#>"))
LRAtsMediationAdapter.configure(atsConfiguration: LRAtsConfiguration(appId: "<#your app id#>"))
// optional
// LRAtsMediationAdapter.hasConsentForNoLegislation = true
Methods
Deprecated for v3.0.0
The methods in this article are deprecated for v3.0.0 and later, since all configurations are automatically set up in these versions.
The methods below are only applicable for iOS SDK v2.9.0 and below.
configure(atsConfiguration: LRAtsConfiguration)
This method prepares the required information to configure LRAtsSDK. For more information, see LRAtsConfiguration.
| Name | Type | Description |
|---|---|---|
| atsConfiguration | LRAtsConfiguration | The object used to configure LRAtsSDK during the adapter's initialization. |
Returns
No return parameter
setIdentifier(identifier: LRIdentifierData)
This method sets an identifier which will be used through a mediation adapter. You must call this method before attempting to retrieve signals.
| Name | Type | Description |
|---|---|---|
| Identifier | LRIdentifierDataChoose one of the following (you cannot use lrIdentifierData directly):- LREmailIdentifier - LRPhoneNumberIdentifier (U.S. only) - LRCustomIdentifier - LRDealIdentifier - LREnvelopeIdentifier | The identifier for which signals will be retrieved. |
adSDKVersion()
This method returns the SDK version as a GADVersionNumber object.
Parameters
No parameter
Returns
GADVersionNumber
adapterVersion()
This method returns the adapter version as a GADVersionNumber object.
Parameters
No parameter
Returns
GADVersionNumber
setUpWith(_:completionHandler:)
This method is automatically called from AdMob SDK once per session instructing the adapter to set up LRAts SDK. The adapter will call completionHandler once it can collect signals, or if it encounters an error while setting up.
| Name | Type | Description |
|---|---|---|
| Configuration | GADMediationServerConfiguration | The configuration from Console that is used to set up LRAtsSDK. In case of LRAtsSDK, all required information is provided through the configure(atsConfiguration:) method. |
Returns
No return parameter
Properties
hasConsentForNoLegislation
This property is used for countries that are not covered by any geo-targeting rules (countries that are not under GDPR or CCPA legislation) configured in Console. Setting this property to true will allow LRAtsSDK to continue and collect signals, otherwise, no signals will be collected.
Updated 4 months ago