If you are integrating the Meson SDK for the first time, we recommend skipping the Update SDK from 1.0.0-beta10 and below to 1.0.0-beta11 section and proceeding with the remaining integration steps.
Beginning with SDK version 1.0.0-beta11, we've enhanced the user signal-gathering process for GDPR and COPPA compliance by consolidating them into a single API. This eliminates the necessity for multiple API calls and offers publishers a centralized solution for comprehensive consent management.
Make sure that you replace the old SDK with the new one.
let gdprConsent = [
MesonConstant.MESON_GDPR_CONSENT_GDPR_APPLIES : "0",
MesonConstant.MESON_GDPR_CONSENT_AVAILABLE : "true",
MesonConstant.MESON_GDPR_CONSENT_IAB : "<IAB_GDPR_STRING>"
]
// Set GDPR consent to MesonSdkConfiguration
let config = MesonSdkConfiguration(appId: "appId", consent: gdprConsent)
// CCPA
private func setExtras() {
var extraData: [String: Any] = [:] // You can notify Meson that restricted data processing is enabled using either of the following parameters.
extraData["rdp"] = false
extraData["iab_usprivacy_string"] = "1YNN"
Meson.setExtras(extraData)
}
NSDictionary *gdprConsent = @{MesonConstant.MESON_GDPR_CONSENT_GDPR_APPLIES: @"0",
MesonConstant.MESON_GDPR_CONSENT_AVAILABLE: @"true",
MesonConstant.MESON_GDPR_CONSENT_IAB: @"<IAB_GDPR_STRING>" };
// Set GDPR consent to MesonSdkConfiguration
MesonSdkConfiguration *config = [[MesonSdkConfiguration alloc] initWithAppId:@"appId" consent:gdprConsent];
//CCPA
- (void)setExtras {
NSMutableDictionary *extras = [[NSMutableDictionary alloc] init];
// You can notify Meson that restricted data processing is enabled using either of the following parameters.
[extras setValue:false forKey:@"rdp"];
[extras setValue:@"1YNN" forKey:@"iab_usprivacy_string"];
[Meson setExtras:extras];
}
let consent: [String: Any] = [
// GDPR - You should send the GDPR consent either in a simple format using MesonConstant.GDPR_CONSENT_AVAILABLE or in IAB format using MesonConstant.GDPR_CONSENT.
MesonConstant.GDPR: 1,
MesonConstant.GDPR_CONSENT: "<IAB_GDPR_STRING>",
MesonConstant.GDPR_CONSENT_AVAILABLE: 1,
// CCPA - You can notify Meson that restricted data processing in a simple format using MesonConstant.DO_NOT_SELLL or in IAB format using MesonConstant.US_PRIVACY.
MesonConstant.US_PRIVACY: "<US_PRIVACY>",
MesonConstant.DO_NOT_SELL: false
]
Meson.setConsent(consent)
NSDictionary *consent = @{
// GDPR - You should send the GDPR consent either in a simple format using MesonConstant.GDPR_CONSENT_AVAILABLE or in IAB format using MesonConstant.GDPR_CONSENT.
MesonConstant.GDPR: @1,
MesonConstant.GDPR_CONSENT: @"<IAB_GDPR_STRING>",
MesonConstant.GDPR_CONSENT_AVAILABLE: @1,
// CCPA - You can notify Meson that restricted data processing in a simple format using MesonConstant.DO_NOT_SELLL or in IAB format using MesonConstant.US_PRIVACY.
MesonConstant.US_PRIVACY: @"<US_PRIVACY>",
MesonConstant.DO_NOT_SELL: @NO
};
[Meson setConsent:consent];
Meson.updateGDPRConsent(_ consent: [String: Any]?)
has been substituted with the new API Meson.setConsent(_ consent: [String: Any]?)
.setExtras
API. In the updated SDK, this process is modified to utilize the aforementioned setConsent
API for transmitting CCPA user signals. Ensure that you remove the outdated method of transmitting CCPA user signals.In the above snippet, the old constants have been replaced with new constants, and the data type of a few values has been changed as follows:
Old Constant | New Constant | Old Value Data Type | New Value Data Type |
---|---|---|---|
MesonConstant.MESON_GDPR_CONSENT_AVAILABLE |
MesonConstant.GDPR_CONSENT_AVAILABLE |
String | Integer |
MesonConstant.MESON_GDPR_CONSENT_IAB |
MesonConstant.GDPR_CONSENT |
No Change | |
MesonConstant.MESON_GDPR_CONSENT_GDPR_APPLIES |
MesonConstant.GDPR |
String | Integer |
iab_usprivacy_string |
MesonConstant.US_PRIVACY |
No Change | |
rdp |
MesonConstant.DO_NOT_SELL |
No Change |
Meson.setConsent(_ consent: [String: Any]?)
Meson.getConsent() -> [String: Any]?
You can agree or deny the GDPR compliance at the account and app level. For more information about the setup at the account level, see Privacy & Compliance, and for the app level, see Select GDPR and COPPA settings.
If you opt to transmit user signals pertaining to GDPR, Meson SDK offers a solution to align with GDPR guidelines. With the help of setConsent
API, you can conveniently employ the following keys to transmit the corresponding values, thus ensuring compliance with GDPR regulations.
You should send the GDPR consent in a simple format using MesonConstant.GDPR_CONSENT_AVAILABLE
or in IAB format using MesonConstant.GDPR_CONSENT
.
Keys | Values | Description |
---|---|---|
MesonConstant.GDPR_CONSENT_AVAILABLE |
0 or 1 (Integer) | 0 - Denied. 1 - consented Any other value - Considered Denied. |
MesonConstant.GDPR |
0 or 1 (Integer) | 0 - GDPR applies in this region. 1 - GDPR does not apply. |
MesonConstant.GDPR_CONSENT |
“ConsentString in V1 format“ (String) OR “ConsentString in V2 format“ (String) | For more information, see IAB specification. Note: If any CMP is used to collect info, SDK reads that info from shared preferences. |
You can choose to restrict data processing at an App level. For more information, see Select GDPR and COPPA settings. If you transmit user signals concerning CCPA, Meson SDK facilitates compliance with the California Consumer Privacy Act (CCPA).
Meson SDK allows you to employ either of the following keys through the setConsent
API to effortlessly enable or disable restricted data processing (RDP), aligning with CCPA regulations.
Keys | Values | Description |
---|---|---|
MesonConstant.US_PRIVACY |
“1YNN“ (String) For demo purposes only |
For more information on signaling restricted data processing, see IAB specification. Any other value - Considered Denied. |
MesonConstant.DO_NOT_SELL |
True or false (Boolean) | True - user opted out of the sale of his or her personal information. False - Do Not restrict the processing of user data. |
After configuring GDPR and COPPA settings, the final snippet will resemble the example provided below:
let consent: [String: Any] = [
MesonConstant.GDPR: 1,
MesonConstant.GDPR_CONSENT: "<IAB_GDPR_STRING>",
MesonConstant.GDPR_CONSENT_AVAILABLE: 1,
MesonConstant.US_PRIVACY: "<US_PRIVACY>",
MesonConstant.DO_NOT_SELL: false
]
Meson.setConsent(consent)
NSDictionary *consent = @{
MesonConstant.GDPR: @1,
MesonConstant.GDPR_CONSENT: @"<IAB_GDPR_STRING>",
MesonConstant.GDPR_CONSENT_AVAILABLE: @1,
MesonConstant.US_PRIVACY: @"<US_PRIVACY>",
MesonConstant.DO_NOT_SELL: @NO
};
[Meson setConsent:consent];
To access consent signals at any point in time, employ the following code snippet:
let consent = Meson.getConsent()
NSDictionary *consent = [Meson getConsent];