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 onCMPUIStatusChanged
notifies when the CMP UI status is changed. Whenever there is any change made to the CMP UI, this callback will be called.
Attribute | Data Type | Description |
---|---|---|
`status`(DisplayInfo) |
Object | Provides information related to CMP UI and the regulation shown. |
override fun onCMPUIStatusChanged(status: DisplayInfo) {
//Use onCMPUIStatusChanged to know the information related to CMP UI.
Log.i("InmobiCmpSampleApp", status.displayStatus)
}
@Override
public void onCMPUIStatusChanged(DisplayInfo displayInfo) {
//Use onCMPUIStatusChanged to know the information related to CMP UI.
Log.i("InmobiCmpSampleApp", displayInfo.getDisplayStatus());
}
The onReceiveUSRegulationsConsent
notifies that the user has finished giving or updating consent to an MSPA regulation.
Attribute | Data Type | Description |
---|---|---|
`usRegulationData`(USRegulationData) |
Object | Provides consent information related to MSPA regulation. |
override fun onReceiveUSRegulationsConsent(usRegulationData: USRegulationData) {
//Use USRegulationData to know the consent information related to MSPA regulation.
Log.i("InmobiCmpSampleApp", usRegulationData.gppString)
}
@Override
public void onReceiveUSRegulationsConsent(USRegulationData usRegulationData) {
//Use USRegulationData to know the consent information related to MSPA regulation.
Log.i("InmobiCmpSampleApp", usRegulationData.getGppString());
}
The onUserMovedToOtherState
notifies that the applicable regulation is MSPA and user moved to another state due to which the applicable regulation is changed
override fun onUserMovedToOtherState() {
// Use onUserMovedToOtherState to know when the user has moved to another US state.
}
@Override
public void onUserMovedToOtherState() {
// Use onUserMovedToOtherState to know when the user has moved to another US state.
}
The onActionButtonClicked
notifies when the user has clicked any of the action buttons related to Consent or Pay on the CMP UI.
Attribute | Data Type | Description |
---|---|---|
`actionButton`(ActionButton) |
Object | Provides information related to action buttons of Consent or Pay. |
override fun onActionButtonClicked(actionButton: ActionButton) {
//Use onActionButtonClicked to know the information related to action buttons of Cosnent or Pay.
Log.i("InmobiCmpSampleApp", "onActionButtonClicked: $actionButton")
}
@Override
public void onActionButtonClicked(ActionButton actionButton) {
//Use onActionButtonClicked to know the information related to action buttons of Cosnent or Pay.
Log.i("InmobiCmpSampleApp", "onActionButtonClicked: "+actionButton);
}
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 when the user has finished giving consent to a CCPA regulation.
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.