iOS

This topic outlines various InMobi CMP Android SDK callbacks, designed to empower publishers with the information needed for seamless integration and consent details retrieval. 

didReceiveIABVendorConsent

Purpose

This callback is triggered upon obtaining user consent for IAB-compliant vendors.

Parameters

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.

Example

Objective-C

-(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);
}

Swift

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)
}

didRecieveNonIABVendorConsent

Purpose

The didRecieveNonIABVendorConsent callback pertains to vendors configured in the InMobi CMP and do not automatically validate consent.

Parameters

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.

Example

Objective-C

-(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);
}

Swift

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)
}

didReceiveAdditionalConsent

Purpose

The didReceiveAdditionalConsent callback is specifically invoked if you have enabled Google Vendors in the portal.

Parameters

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.

Example

Objective-C

-(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);
}

Swift

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)
    
 }

cmpDidLoad

Purpose

The cmpDidLoad notifies the publishers that the CMP has been intialised successfully and also provides some information in the PingResponse object.

Parameters

Attribute Data Type Description
`info`(PingResponse) Object Information related to cmp version, cmp status etc.

Example

Objective-C

-(void)cmpDidLoadWithInfo:(PingResponse * _Nonnull)info { 
    NSLog(@"%@", NSStringFromSelector(_cmd));
    NSLog(@"%ld", info.cmpId);
    NSLog(@"%ld", info.cmpVersion);
}

Swift

func cmpDidLoad(info: PingResponse) {
        print("CMP loaded successfully")

        print("cmpId: \(info.cmpId)")
        print("cmp version: \(info.cmpVersion)")
    }

cmpDidShow

Purpose

The cmpDidShow notifies the GDPR consent screen has been shown to publisher and also provides some information in the PingResponse object.

Parameters

Attribute Data Type Description
`info`(PingResponse) Object Information related to cmp version, cmp status etc.

Example

Objective-C

-(void)cmpDidShowWithInfo:(PingResponse * _Nonnull)info { 
    NSLog(@"%@", NSStringFromSelector(_cmd));
    NSLog(@"%ld", info.cmpId);
    NSLog(@"%ld", info.cmpVersion);
}

Swift

func cmpDidShow(info: PingResponse) {
        print("GDPR popup shown successfully")

        print("cmpId: \(info.cmpId)")
        print("cmp version: \(info.cmpVersion)")
}

cmpDidError

Purpose

The cmpDidError notifies the publisher that some error has occurred and also provides information about the error in the error object.

Parameters

Attribute Data Type Description
`error`(Error) Object Information related to error.

Example

Objective-C

-(void)cmpDidErrorWithError:(NSError * _Nonnull)error { 
    NSLog(@"%@, error: %@", NSStringFromSelector(_cmd), error.localizedDescription);
}

Swift

func cmpDidError(error: Error) {
        print("Some error occurred during cmp initialisation")
        print("error: " + error.localizedDescription)
    }

didReceiveCCPAConsent

Purpose

The didReceiveCCPAConsent notifies the GDPR consent screen has been shown to publisher and also provides some information in the PingResponse object.

Parameters

Attribute Data Type Description
`string`:String String Represents the CCPA consent information received.

Example

Objective-C

-(void)didReceiveCCPAConsentWithString:(NSString *)string {
    // Use the string for CCPA consent
}

Swift

func didReceiveCCPAConsent(string: String) {
    // Use the string for CCPA consent
}


On This Page

Last Updated on: 27 Mar, 2024