예제 #1
0
    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();
    }
예제 #2
0
 /// <summary>
 /// Sends off an asynchronous network request to load the MoPub consent dialog.
 /// </summary>
 public void LoadConsentDialog()
 {
     MoPub.LoadConsentDialog();
 }
예제 #3
0
 private void Start()
 {
     MoPub.LoadConsentDialog();
 }