1. Import the InMobi SDK header and initialize it.
InMobiSdk.init(this, "Insert InMobi Account ID here", consentObject, new SdkInitializationListener() {
@Override
public void onInitializationComplete(@Nullable Error error) {
if (null != error) {
Log.e(TAG, "InMobi Init failed -" + error.getMessage());
} else {
Log.d(TAG, "InMobi Init Successful");
}
}
});
2. Create a user data model as follows:
InMobiUserDataTypes phoneNumber = new
InMobiUserDataTypes.Builder().md5("2wse3e").sha1("5tfg7yh").sha256("6tghjk").build();
InMobiUserDataTypes emailId = new I
nMobiUserDataTypes.Builder().md5("ujhjk99").sha1("9ujkhgtyf").sha256("jhjyure4").build();
HashMap<String, String> extras = new HashMap<>();
extras.put("appSpecificUniqueId", "XXXXXXXX");
InMobiUserDataModel userDataModel = new
InMobiUserDataModel.Builder().phoneNumber(phoneNumber).emailId(emailId).extras(extras).build();
3. Pass this data model to fetch the API.
InMobiUnifiedIdService.push(userDataModel)
4. Use this API to fetch the UnifIDs.
InMobiUnifiedIdService.fetchUnifiedIDs(this)
Implement the following delegates to receive the callbacks.
class MyActivity implements InMobiUnifiedIDInterface {
@Override
public void onFetchCompleted(JSONObject response, Error error) {
}
}
Call this reset API to clear all the user-related data and Ids stored in the SDK.
InMobiUnifiedIdService.reset()
If you have an ID from a Vendor, you can use it in the following SDK. If there is an overlap, the system prioritizes the InMobi procured Unified IDs.
InMobiSdk.setPublisherProvidedUnifiedID(JSONObject unifiedIds);
JSONObject structure:
{
"id5" : "json(blob)",
"live Ramp": "json(blob)"
}
InMobi’s Unifi APIs expects hashed e-mail or telephone numbers to generate the identity envelope. To enhance matching, ensure to
Example: test@example.com, test@gmail.com.
For email ids with @gmail.com:
By installing this SDK update, you agree that your Children Privacy Compliance setting remains accurate or that you will update that setting, whenever there is a change in your app's audience. You may update the app's Children Privacy Compliance settings at https://publisher.inmobi.com/my-inventory/app-and-placements.