This topic outlines various InMobi CMP Android SDK callbacks, designed to empower publishers with the information needed for seamless integration and consent details retrieval.
The onCmpLoaded
notifies the publishers that the CMP has been intialised successfully and also provides some information in the PingReturn
object.
Attribute | Data Type | Description |
---|---|---|
info`(PingReturn) |
Object | Information related to cmp version, cmp status etc. |
override fun onCmpLoaded(info: PingReturn) {
Log.i("InmobiCmpSampleApp", "Cmp loaded successfully")
Log.i("InmobiCmpSampleApp", "Cmp Id: ${info.cmpId}")
}
@Override
public void onCmpLoaded(PingReturn info) {
Log.i("InmobiCmpSampleApp", "Cmp loaded successfully");
Log.i("InmobiCmpSampleApp", "Cmp Id: " + info.getCmpId());
}
The onCmpUIShown
notifies the GDPR consent screen has been shown to publisher and also provides some information in the PingReturn
object.
Attribute | Data Type | Description |
---|---|---|
info`(PingReturn) |
Object | Information related to cmp version, cmp status etc. |
override fun onCmpUIShown (info: PingReturn) {
Log.i("InmobiCmpSampleApp", "Cmp UI shown successfully")
Log.i("InmobiCmpSampleApp", "Cmp Id: ${info.cmpId}")
}
@Override
public void onCmpUIShown (PingReturn info) {
Log.i("InmobiCmpSampleApp", " Cmp UI shown successfully ");
Log.i("InmobiCmpSampleApp", "Cmp Id: " + info.getCmpId());
}
This callback is triggered upon obtaining user consent for IAB-compliant vendors.
Attribute | Data Type | Description |
---|---|---|
`tcData`TCData |
String | Provides the consent information related to IAB vendors. |
override fun onIABVendorConsentGiven(tcData: TCData) {
// Use TCData to know the consent information related to IAB vendors
Log.i("onIABVendorConsentGiven", tcData.gdprApplies.toString())
Log.i("onIABVendorConsentGiven", tcData.tcString ?: "")
}
@Override
public void onIABVendorConsentGiven(TCData tcData) {
// Use TCData to know the consent information related to IAB vendors Log.i("onIABVendorConsentGiven", String.valueOf(tcData.getGdprApplies())); Log.i("onIABVendorConsentGiven", tcData.getTcString() != null ? tcData.getTcString() : "");
}
The onNonIABVendorConsentGiven
callback pertains to vendors configured in the InMobi CMP and do not automatically validate consent.
Attribute | Data Type | Description |
---|---|---|
`nonIABData`NonIABData |
String | Provides the consent information related to non- IAB vendors. |
override fun onNonIABVendorConsentGiven(nonIABData: NonIABData) {
//Use NonIABData to know the consent information related to Non-IAB vendors
Log.i("onNonIABVendorConsent", nonIABData.toString())
// Use nonIabData.nonIabVendorConsents to checkout the vendor consents
Log.i("onNonIABVendorConsent", nonIABData.nonIabVendorConsents.toString())
Log.i("onNonIABVendorConsent", nonIABData.gdprApplies.toString())
}
@Override
public void onNonIABVendorConsentGiven(NonIABData nonIABData) {
// Use NonIABData to know the consent information related to Non-IAB vendors Log.i("onNonIABVendorConsent", nonIABData.toString());
// Use nonIABData.getNonIabVendorConsents() to check out the vendor consents Log.i("onNonIABVendorConsent", nonIABData.getNonIabVendorConsents().toString()); Log.i("onNonIABVendorConsent", String.valueOf(nonIABData.getGdprApplies()));
}
The onCmpError
notifies the publisher that some error has occurred and also provides information about the error in the `error` object.
Attribute | Data Type | Description |
---|---|---|
`error`(ChoiceError) |
Object | Information related to error. |
override fun onCmpError(error: ChoiceError) {
Log.i("InmobiCmpSampleApp", "An error occurred during initialisation")
Log.i("Error", error.message)
}
@Override
public void onCmpError(ChoiceError error) {
Log.i("InmobiCmpSampleApp", "An error occurred during initialization");
Log.i("Error", error.getMessage());
}
The onGoogleVendorConsentGiven
callback is specifically invoked if you have enabled Google Vendors in the portal.
Attribute | Data Type | Description |
---|---|---|
`acData`(ACData) |
Object | Provides consent information related to Google vendors. |
override fun onGoogleVendorConsentGiven(acData: ACData) {
//Use ACData to know the consent information related to Google vendors
Log.i("InmobiCmpSampleApp", acData.acString ?: "")
}
@Override
public void onGoogleVendorConsentGiven(ACData acData) {
// Use ACData to know the consent information related to Google vendors
Log.i("InmobiCmpSampleApp", acData.getAcString() != null ? acData.getAcString() : "");
}
The onCCPAConsentGiven
notifies the GDPR consent screen has been shown to publisher and also provides some information in form of string.
Attribute | Data Type | Description |
---|---|---|
`consentString`(String) |
String | Represents the CCPA consent information received. |
override fun onCCPAConsentGiven(consentString: String) {
// Use the string for CCPA consent
Log.i("onCCPAConsentGiven", consentString)
}
@Override
public void onCCPAConsentGiven(String consentString) {
// Use the string for CCPA consent
Log.i("onCCPAConsentGiven", consentString);
}
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.