Android APIs

Portal Configuration and Setup for MSPA

To configure MSPA in the InMobi CMP portal, see Portal Configuration and SDK Changes.

APIs to Trigger MSPA Consent Screen

This section outlines the various APIs and callbacks that publishers can use to trigger the MSPA consent screen once they are integrated with GPP.

Display MSPA Screen

To display MSPA screen, call the following method:

Example

Kotlin

ChoiceCmp.showUSRegulationScreen(this)

Java

ChoiceCmp.showUSRegulationScreen(this);

Note

If you have enabled auto-trigger MSPA, MSPA screen will be shown automatically after initialization.

Callbacks

Manage MSPA consent

The callback onReceiveUSRegulationsConsent is triggered when the user gives consent to MSPA. The callback is also triggered when the consent changes as it is opt-out by default. You will get consent details in usRegulationData.

Kotlin

override fun onReceiveUSRegulationsConsent(usRegulationData: USRegulationData) {
    // use usRegulationData to retrieve info related to MSPA
}

Java

@Override
public void onReceiveUSRegulationsConsent(USRegulationData usRegulationData) { 
    // use usRegulationData to retrieve info related to MSPA 
}

User Location Changed

The callback onUserMovedToOtherState is triggered when the user changes location due to which the applicable MSPA consent changes. You can retrigger MSPA if you want new consent according to the new location.

Kotlin

override fun onUserMovedToOtherState() {
	//use this to retrigger MSPA to renew consent
}

Java

@Override
public void onUserMovedToOtherState() { 
    // Use this to retrigger MSPA to renew consent 
}


You can retrieve MSPA related strings in the following keys:

Attribute Description
IABGPP_HDR_Version GPP Version
IABGPP_HDR_Sections

List of Section IDs

IABGPP_HDR_GppString

Full consent string in its encoded form

IABGPP_GppSID Section ID(s) considered to be in force. Multiple IDs are separated by an underscore, e.g. “2_3”
IABGPP_[SectionID]_String

String representation of each section. E.g. IAB TCF EU v2 String will be found at IABGPP_2_String

On This Page

Last Updated on: 06 Sep, 2024