EUID Client-Side Integration Guide for Mobile
This guide is for mobile app publishers who want to integrate with EUID with changes only within their mobile app.
These instructions do not apply to publishers who want to use a Private Operator, or who want to generate tokens server-side. Those publishers should follow the Client-Server Integration Guide for Mobile.
This page provides a high-level overview of integration steps and links to additional documentation.
EUID provides mobile SDKs for Android and iOS. Each SDK has the following features:
- Generates an EUID identity (an EUID token and associated values) and persists it in local file storage.
- Automatically refreshes EUID tokens.
This guide uses the group term EUID mobile SDKs to include both the SDK for Android and the SDK for iOS.
For FAQs relating to mobile publisher integrations, see FAQs for Mobile Integrations.
To integrate with EUID client-side, you'll need to complete the following steps:
-
Check that the token was successfully generated and then pass it for bidstream use.
-
Optionally, integrate the EUID GMA/IMA Plugin for GAM Secure Signals integration.
Mobile SDK Version
This guide provides instructions for using either of these EUID mobile SDKs:
- SDK for Android (version 1.6.0 or later)
- SDK for iOS (version 1.7.0 or later)
For instructions for installing the correct SDK/version into your mobile app, see Add the EUID Mobile SDK to Your Mobile App.
Client-Side Integration Example
For an example of how to configure an EUID mobile SDK, and how to generate tokens using client-side integration for mobile, you can try out the EUID development app.
Follow the applicable instructions, for Android or iOS:
- Android
- iOS
- Check out the main branch of the SDK for Android source code repository on GitHub.
- In Android Studio (check the version required in the Minimum Requirements section in the SDK for Android Reference Guide), open the directory that you checked out.
- In AndroidManifest.xml, set
uid2_environment_euid
totrue
. - Run the dev-app app.
- When you've started the app, make sure that the Client Side checkbox is checked.
- Enter an email address or phone number, and then click the arrow to the right.
EUID
-
Check out the main branch of the EUID SDK For iOS source code repository on GitHub.
-
In Xcode, open this project file:
Development/UID2SDKDevelopmentApp/UID2SDKDevelopmentApp.xcodeproj
-
In
Development/UID2SDKDevelopmentApp/UID2SDKDevelopmentApp/Info.plist
in Xcode's editor, set theUID2EnvironmentEUID
key toYES
. Alternatively, you can useplutil
from the command line:plutil -replace UID2EnvironmentEUID -bool YES Development/UID2SDKDevelopmentApp/UID2SDKDevelopmentApp/Info.plist
to revert back to using a UID2 environment:
plutil -replace UID2EnvironmentEUID -bool NO Development/UID2SDKDevelopmentApp/UID2SDKDevelopmentApp/Info.plist
-
Run the UID2SDKDevelopmentApp app scheme.
-
When you've started the app, make sure that the Client Side checkbox is checked.
-
Enter an email or phone number, and then click the arrow to the right.
Behind the scenes, the development app makes the following EUID SDK API call. This call sends a request to the EUID service to generate an identity (an EUID token and associated values) for the email/phone input:
- Android
- iOS
EUIDManager.getInstance().generateIdentity(
identityRequest: IdentityRequest,
subscriptionId: String,
publicKey: String,
onResult: (GenerateIdentityResult) -> Unit
)
EUIDManager.shared.generateIdentity(
_ identity: IdentityType,
subscriptionID: String,
serverPublicKey: String,
appName: String? = nil
)
When the API call is successful, the app displays the resulting identity and persists it inside the EUIDManager
class.
The identity includes the generated EUID advertising token value, which you can retrieve using the getAdvertisingToken()
method call:
- Android
- iOS
EUIDManager.getInstance().getAdvertisingToken()
EUIDManager.shared.getAdvertisingToken()
This method call returns the value that you need to make an ad request: see Pass Generated Token for Bidstream Use.
Testing With Your Own Configuration
By default, the development app uses default values for Subscription ID and public key, which are stored in the following object:
- Android
- iOS
com.uid2.dev.ui.MainScreenViewModel.Companion
RootViewModel
By default, the development app is configured to connect to the EUID integration environment, as specified in the following Android method call/iOS file:
- Android
- iOS
com.uid2.EUIDManager.Companion#init
see UID2SDKDevelopmentApp/UID2SDKDevelopmentApp/Info.plist
If necessary, you can also change the default Subscription ID and public key to values assigned to you, and connect to the EUID Production environment. For details, see Optional: Specifying the API Base URL to Reduce Latency.
Integrating with Single Sign-On (SSO)
If you integrate with one or more SSO providers to offer SSO login, you might be able to retrieve the logged-in user's email address from the SSO provider to generate EUID tokens.
For details, see Publisher Integration with SSO Providers.
Complete the EUID Account Setup
To set up your account, follow the steps described in Account Setup. As part of the account setup process, you'll need to provide a list of app names for all the mobile apps that you'll be integrating with the EUID mobile SDKs, including any of these values that apply:
- Android Application ID
- iOS Bundle Identifier
- iOS App Store ID
When account setup is complete, you'll receive a client keypair consisting of two values that identify you to the EUID servers: Subscription ID and public key. These values are unique to you, and you'll use them when you configure the EUID mobile SDK. For details, see Subscription ID and Public Key.
Add the EUID Mobile SDK to Your Mobile App
To add the mobile SDK to your app, follow the applicable documentation:
At this point, you are ready to start generating EUID tokens using the SDK.
Using the EUID Integration Environment
By default, the SDK is configured to work with the EUID production environment: https://prod.euid.eu/v2
. If you want to use the integration environment instead, provide the following URL in your call to initialize EUIDManager
:
- Android
- iOS
EUIDManager.init(
context = this,
EUIDManager.Environment.Custom("https://integ.euid.eu/v2"),
)
// Must be set before EUIDManager.shared is accessed
UID2Settings.shared.euidEnvironment = .custom(
url: URL(string: "https://integ.euid.eu/v2")!
)
Bear in mind the following differences between environments:
- Tokens from the EUID integration environment are not valid for passing to the bidstream.
- You'll have a different set of Subscription ID and public key values for each environment (integration and production). Be sure to use the correct values for each environment.
Optional: Specifying the API Base URL to Reduce Latency
By default, this SDK makes calls to an EUID production environment server in the USA.
For information about how to choose the best URL for your use case, and a full list of valid base URLs, see Environments.
To specify an EUID server that is not the default, you can make config changes, as shown in the following examples:
- Android
- iOS
EUIDManager.init(
context = this,
EUIDManager.Environment.Custom("https://prod.euid.eu/v2")
)
// Must be set before EUIDManager.shared is accessed
UID2Settings.shared.euidEnvironment = .custom(
url: URL(string: "https://prod.euid.eu/v2")!
)
// or use a named environment
UID2Settings.shared.euidEnvironment = .london