Obtaining Required Identifiers
Your monetization partners may directly accept a supported identifier (such as an email address or phone number) or expect you to pre-resolve a user identifier to a LiveRamp identity envelope. Ask your partner(s) which identifiers they accept, then implement one of the two workflows below.
Obtain Email/Phone
if (user) {
// The user's ID, unique to the Firebase project.
// Do NOT use this value to authenticate with your backend server,
// if you have one. Use getTokenWithCompletion:completion: instead.
NSString *email = user.email;
NSString *uid = user.uid;
NSMutableString *multiFactorString = [NSMutableString stringWithFormat:@"MultiFactor: "];
for (FIRMultiFactorInfo *info in user.multiFactor.enrolledFactors) {
[multiFactorString appendString:info.displayName];
[multiFactorString appendString:@" "];
}
NSURL *photoURL = user.photoURL;
// ...
}MainViewController.mhttps://firebase.google.com/docs/auth/ios/start#objective-c_6
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
// Name, email address, and profile photo Url
String name = user.getDisplayName();
String email = user.getEmail();
Uri photoUrl = user.getPhotoUrl();
// Check if user's email is verified
boolean emailVerified = user.isEmailVerified();
// The user's ID, unique to the Firebase project. Do NOT use this value to
// authenticate with your backend server, if you have one. Use
// FirebaseUser.getIdToken() instead.
String uid = user.getUid();
}https://firebase.google.com/docs/auth/android/start#access_user_information
Using a different authentication system and unsure where to start?Email us at [email protected]!
Obtain Identity Envelope
If your partner SDK expects an identity envelope, you will need to resolve your user identifier to an identity envelope.
While it's possible to automatically run a Cloud Function when a Firebase onCreate() or onDelete() is triggered, there is no onSignIn() event. Therefore, you will need to run a custom function that fires (either server-side or client-side) once the user has signed in.
The function will need to:
- Accept your supported identifier
- Hash the identifier to supported isotopes (MD5, SHA1, SHA256)
- Call the ATS API
- Process the response and handle errors
- Return the envelope
It is recommended to run this function every time the user opens a new app session.
Updated 2 days ago