This topic outlines various InMobi CMP Android SDK callbacks, designed to empower publishers with the information needed for seamless integration and consent details retrieval.
This callback is triggered upon obtaining user consent for IAB-compliant vendors.
Attribute | Data Type | Description |
---|---|---|
TCData |
Boolean | Provides the consent information related to IAB vendors. |
gdprApplies |
String | Indicates if the GDPR applies or not. |
tcData.vendor.consents |
String | Provides information on vendor consents. |
-(void)didReceiveIABVendorConsentWithTcData:(TCData * _Nonnull)tcData updated:(BOOL)updated {
// Use TCData to know the consent information related to IAB vendors
// Use gdprApplies to check if the gdpr applies or not
NSLog(@"%d", tcData.doesGdprApply);
// Use tcData.vendor.consents to checkout the vendor consents
NSLog(@"%@", tcData.vendor.consents);
}
func didReceiveIABVendorConsent(tcData: TCData, updated: Bool) {
// Use TCData to know the consent information related to IAB vendors
// Use gdprApplies to check if the gdpr applies or not
print(tcData.gdprApplies)
// Use tcData.vendor.consents to checkout the vendor consents
print(tcData.vendor.consents)
}
The didRecieveNonIABVendorConsent
callback pertains to vendors configured in the InMobi CMP and do not automatically validate consent.
Attribute | Data Type | Description |
---|---|---|
NonIABData |
Boolean | Provides the consent information related to non- IAB vendors. |
gdprApplies |
String | Indicates if the GDPR applies or not. |
nonIabData.nonIabVendorConsents |
String | Provides information on vendor consents. |
-(void)didReceiveNonIABVendorConsentWithNonIabData:(NonIABData * _Nonnull)nonIabData updated:(BOOL)updated {
//Use NonIABData to know the consent information related to Non-IAB vendors
// Use gdprApplies to check if the gdpr applies or not
NSLog(@"%@", nonIabData.gdprApplies);
// Use nonIabData.nonIabVendorConsents to checkout the vendor consents
NSLog(@"%@", nonIabData.nonIabVendorConsents);
}
func didReceiveNonIABVendorConsent(nonIabData: NonIABData, updated: Bool) {
//Use NonIABData to know the consent information related to Non-IAB vendors
// Use gdprApplies to check if the gdpr applies or not
print(nonIabData.gdprApplies)
// Use nonIabData.nonIabVendorConsents to checkout the vendor consents
print(nonIabData.nonIabVendorConsents)
}
The didReceiveAdditionalConsent
callback is specifically invoked if you have enabled Google Vendors in the portal.
Attribute | Data Type | Description |
---|---|---|
ACData |
Boolean | Provides consent information related to Google vendors. |
gdprApplies |
String | Indicates if the GDPR applies or not. |
acData.additionalVendorConsent |
String | Provides information on vendor consents. |
-(void)didReceiveAdditionalConsentWithAcData:(ACData * _Nonnull)acData updated:(BOOL)updated {
//Use ACData to know the consent information related to Google vendors
// Use gdprApplies to check if the gdpr applies or not
NSLog(@"%d", acData.gdprApplies);
// Use acData.additionalVendorConsent to checkout the vendor consents
NSLog(@"%@", acData.additionalVendorConsent);
}
func didReceiveAdditionalConsent(acData: ACData, updated: Bool) {
//Use ACData to know the consent information related to Google vendors
// Use gdprApplies to check if the gdpr applies or not
print(acData.gdprApplies)
// Use acData.additionalVendorConsent to checkout the vendor consents
print(acData.additionalVendorConsent)
}
The cmpDidLoad
notifies the publishers that the CMP has been intialised successfully and also provides some information in the PingResponse
object.
Attribute | Data Type | Description |
---|---|---|
`info`(PingResponse) |
Object | Information related to cmp version, cmp status etc. |
-(void)cmpDidLoadWithInfo:(PingResponse * _Nonnull)info {
NSLog(@"%@", NSStringFromSelector(_cmd));
NSLog(@"%ld", info.cmpId);
NSLog(@"%ld", info.cmpVersion);
}
func cmpDidLoad(info: PingResponse) {
print("CMP loaded successfully")
print("cmpId: \(info.cmpId)")
print("cmp version: \(info.cmpVersion)")
}
The cmpDidShow
notifies the GDPR consent screen has been shown to publisher and also provides some information in the PingResponse
object.
Attribute | Data Type | Description |
---|---|---|
`info`(PingResponse) |
Object | Information related to cmp version, cmp status etc. |
-(void)cmpDidShowWithInfo:(PingResponse * _Nonnull)info {
NSLog(@"%@", NSStringFromSelector(_cmd));
NSLog(@"%ld", info.cmpId);
NSLog(@"%ld", info.cmpVersion);
}
func cmpDidShow(info: PingResponse) {
print("GDPR popup shown successfully")
print("cmpId: \(info.cmpId)")
print("cmp version: \(info.cmpVersion)")
}
The cmpDidError
notifies the publisher that some error has occurred and also provides information about the error in the error
object.
Attribute | Data Type | Description |
---|---|---|
`error`(Error) |
Object | Information related to error. |
-(void)cmpDidErrorWithError:(NSError * _Nonnull)error {
NSLog(@"%@, error: %@", NSStringFromSelector(_cmd), error.localizedDescription);
}
func cmpDidError(error: Error) {
print("Some error occurred during cmp initialisation")
print("error: " + error.localizedDescription)
}
The didReceiveCCPAConsent
notifies the GDPR consent screen has been shown to publisher and also provides some information in the PingResponse
object.
Attribute | Data Type | Description |
---|---|---|
`string`:String |
String | Represents the CCPA consent information received. |
-(void)didReceiveCCPAConsentWithString:(NSString *)string {
// Use the string for CCPA consent
}
func didReceiveCCPAConsent(string: String) {
// Use the string for CCPA consent
}
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.