iOS 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

After initializing the SDK, you can present the MSPA screen by invoking the following method from ChoiceCmp class and pass in the delegate object for registering CCPA callback.

ChoiceCmp.shared.showUSRegulations(ccpaDelegate: self)

Note

If you select US Privacy string from the portal, the MSPA consent screen will be presented and the corresponding consent will be taken.

Once the user has given the consent, didReceiveUSRegulationsConsent(usRegData: USRegulationsData) delegate will be fired.

Note

The showCCPAScreen callback is deprecated. It is recommended to use MSPA showUSRegulationScreen for obtaining consent in the U.S.

Callbacks

Manage MSPA consent

The callback didReceiveUSRegulationsConsent is triggered when the user gives consent to MSPA. You will get consent details in usRegulationsData.

func didReceiveUSRegulationsConsent(usRegData: USRegulationsData) { 
   print("\(#function), gppString: \(usRegData.gppString)") 
} 

User Location Changed

The callback userDidMoveToOtherState is triggered when the user changes location accompanied by the change in regulations. You can retrigger the MSPA popup if you want to retrieve new consent as per the new location.

Note

To check whether US Regulations are applicable for the user, leverage usRegulationApplies flag as part of the PingResponse object. The PingResponse object can be accessed within the cmpDidLoad callback. The same object is returned by the ChoiceCmp.shared.ping() method.

func userDidMoveToOtherState() { 
    print(#function) 
}

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: 13 Sep, 2024