private void CreateUserConsentSection() { GUILayout.Space(_sectionMarginSize); GUILayout.Label("User Consent"); GUILayout.Label("Can collect personally identifiable information: " + _canCollectPersonalInfo, _smallerFont); GUILayout.Label("Current consent status: " + _currentConsentStatus, _smallerFont); GUILayout.Label("Should show consent dialog: " + _shouldShowConsentDialog, _smallerFont); GUILayout.Label( "Is GDPR applicable: " + (_isGdprApplicable != null ? _isGdprApplicable.ToString() : "Unknown"), _smallerFont); GUILayout.BeginHorizontal(); GUI.enabled = !ConsentDialogLoaded || ForceEnableButtons; if (GUILayout.Button("Load Consent Dialog")) { UpdateStatusLabel("Loading consent dialog"); MoPub.LoadConsentDialog(); } GUI.enabled = ConsentDialogLoaded || ForceEnableButtons; if (GUILayout.Button("Show Consent Dialog")) { ClearStatusLabel(); MoPub.ShowConsentDialog(); } GUI.enabled = !_isGdprForced || ForceEnableButtons; if (GUILayout.Button("Force GDPR")) { ClearStatusLabel(); MoPub.ForceGdprApplicable(); UpdateConsentValues(); _isGdprForced = true; } GUI.enabled = true; if (GUILayout.Button("Grant Consent")) { MoPub.PartnerApi.GrantConsent(); } if (GUILayout.Button("Revoke Consent")) { MoPub.PartnerApi.RevokeConsent(); } GUI.enabled = true; GUILayout.EndHorizontal(); }
/// <summary> /// Forces the SDK to treat this app as in a GDPR region. Setting this will permanently force GDPR rules for this /// user unless this app is uninstalled or the data for this app is cleared. /// </summary> public void ForceGdprApplicable() { MoPub.ForceGdprApplicable(); }