SDK Specifications

Overview

This topic defines the API specifications required to configure SDK for Universal ID partners. It is a one-time configuration to enable partnering with multiple Universal ID partners.

Implementation Workflow

Here is an overview of what the general workflow looks like for implementing UnifID.

  1. Initialize the app using InMobi Init API.
  2. Send the hashed PII data (like email/phone/publisher provided id) using MD5/SHA 256 algorithms. It is only applicable for publishers collecting PII data.
  3. Use the UnifID Push API to send the identity details to InMobi’s server.
  4. Before you use InMobiUnifiedIdService API, initialize the InMobi SDK.
  5. If you are a new user, you must call InMobiUnifiedIdService.reset() before InMobiUnifiedIdService.push(userDataModel).
  6. Call InMobiUnifiedIdService.push(userDataModel) for every session.

    Note

    It is recommended to pre-initialize the InMobi SDK before initializing the mediation SDK, but it is not mandatory. This ensures seamless integration as UnifID APIs are enabled before monetization begins. Also, UnifID doesn't affect the mediation stack.

UnifID API Specification

IMUnifiedIdService is a new class and it consists of the following APIs.

API 

Syntax 

Description 

Push 

push(data: IMUserDataModel) 

You should use this API to submit the hashed PII data to the InMobi Id Service. Every time you call this API, the SDK makes a request to InMobi ID Service 
 
It is recommended for you to call this API at the beginning of every app session.

Fetch 

fetchUnifiedIds(delegate: UnifiedIdInterface) 

You should use this to get the UnifIDs. If the UnfIDs expire, the InMobi Id service receives the call to refresh the IDs that are passed to you. 

Reset 

reset() 

You should use this API to clear all the UnifIDs and signatures stored locally in the SDK. 

IMUserDataTypes and IMUserDataModel  

IMUserDataTypes class holds the different variants of user-data that you pass. First, you should create an instance IMUserDataTypes and set the corresponding values for the IMUserDataModel instance. The system passes the instance IMUserDataModel to fetch the function.

IMUserDataTypes 

Property 

Type 

Purpose 

md5 

String 

To provide hashed data using md5 hashing algorithm. 

sha256 

String 

To provide hashed data using SHA256 hashing algorithm. 

IMUserDataModel 

Property 

Type 

Purpose 

phoneNumber 

IMUserDataTypes 

To provide phone number in different variants (md5, etc.).

emailId 

IMUserDataTypes 

To provide email id in different variants (md5, etc.) 

Extras 

Dictionary 

To provide any extra information. 

Please note some data types such as email ID are a prerequisite for some Identity partners.

Callbacks 

SDK calls the “onFetchCompleted” function to notify you about the successful submission of the hashed PII data to the InMobi ID Service. It also shares the list of Universal IDs in the form of a dictionary. SDK doesn't return any expired Universal IDs and calls this function only on the Main Thread. 

Function 

Syntax 

onFetchCompleted 

onFetchCompleted(response: Dictionary?, error: Error?) 

If you set an error object, the SDK calls this function to notify you about the error while submitting the hashed PII data to the InMobi Id Service. 

IMSDK 

You should use this function to pass the UIDs obtained by having direct partnerships with different ID partners (eg. liveramp, id5, etc.), upstream to demand partners, or to other ad exchanges. It helps you to monetize your inventory across the ecosystem. Essentially, it is an existing API within the SDK that enables you to pass universal IDs to InMobi. When both UID and SDK's UnifID service data are present, SDK’s UnifID service takes higher precedence. 

Function 

Syntax 

setPublisherProvidedUnifiedId 

setPublisherProvidedUnifiedId(ids: Dictionary) 

Internal APIs 

To create an ad request, the SDK uses the getUids API internally. 

Function 

Syntax 

getUids 

getUids() -> Dictionary? 

If you set an error object, the SDK calls this function to notify you about the error while submitting the hashed PII data to the InMobi Id Service. 

On This Page

Last Updated on: 09 Feb, 2022