示例#1
0
 private void CreateUserConsentSection()
 {
     GUILayout.Space((float)this._sectionMarginSize);
     GUILayout.Label("User Consent", Array.Empty <GUILayoutOption>());
     GUILayout.Label("Can collect personally identifiable information: " + this._canCollectPersonalInfo, this._smallerFont, Array.Empty <GUILayoutOption>());
     GUILayout.Label("Current consent status: " + this._currentConsentStatus, this._smallerFont, Array.Empty <GUILayoutOption>());
     GUILayout.Label("Should show consent dialog: " + this._shouldShowConsentDialog, this._smallerFont, Array.Empty <GUILayoutOption>());
     GUILayout.Label("Is GDPR applicable: " + (!this._isGdprApplicable.HasValue ? "Unknown" : this._isGdprApplicable.ToString()), this._smallerFont, Array.Empty <GUILayoutOption>());
     GUILayout.BeginHorizontal(Array.Empty <GUILayoutOption>());
     GUI.set_enabled(!this.ConsentDialogLoaded);
     if (GUILayout.Button("Load Consent Dialog", Array.Empty <GUILayoutOption>()))
     {
         this.UpdateStatusLabel("Loading consent dialog");
         MoPubAndroid.LoadConsentDialog();
     }
     GUI.set_enabled(this.ConsentDialogLoaded);
     if (GUILayout.Button("Show Consent Dialog", Array.Empty <GUILayoutOption>()))
     {
         this.ClearStatusLabel();
         MoPubAndroid.ShowConsentDialog();
     }
     GUI.set_enabled(!this._isGdprForced);
     if (GUILayout.Button("Force GDPR", Array.Empty <GUILayoutOption>()))
     {
         this.ClearStatusLabel();
         MoPubAndroid.ForceGdprApplicable();
         this.UpdateConsentValues();
         this._isGdprForced = true;
     }
     GUI.set_enabled(true);
     if (GUILayout.Button("Grant Consent", Array.Empty <GUILayoutOption>()))
     {
         MoPubAndroid.PartnerApi.GrantConsent();
     }
     if (GUILayout.Button("Revoke Consent", Array.Empty <GUILayoutOption>()))
     {
         MoPubAndroid.PartnerApi.RevokeConsent();
     }
     GUI.set_enabled(true);
     GUILayout.EndHorizontal();
 }
示例#2
0
    private void CreateUserConsentSection()
    {
        GUILayout.Space((float)this._sectionMarginSize);
        GUILayout.Label("User Consent", new GUILayoutOption[0]);
        GUILayout.Label("Can collect personally identifiable information: " + this._canCollectPersonalInfo, this._smallerFont, new GUILayoutOption[0]);
        GUILayout.Label("Current consent status: " + this._currentConsentStatus, this._smallerFont, new GUILayoutOption[0]);
        GUILayout.Label("Should show consent dialog: " + this._shouldShowConsentDialog, this._smallerFont, new GUILayoutOption[0]);
        string str = "Is GDPR applicable: ";
        bool?  isGdprApplicable = this._isGdprApplicable;

        GUILayout.Label(str + ((isGdprApplicable == null) ? "Unknown" : this._isGdprApplicable.ToString()), this._smallerFont, new GUILayoutOption[0]);
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUI.enabled = !this.ConsentDialogLoaded;
        if (GUILayout.Button("Load Consent Dialog", new GUILayoutOption[0]))
        {
            this._status = "Loading consent dialog";
            MoPubAndroid.LoadConsentDialog();
        }
        GUI.enabled = this.ConsentDialogLoaded;
        if (GUILayout.Button("Show Consent Dialog", new GUILayoutOption[0]))
        {
            this._status = string.Empty;
            MoPubAndroid.ShowConsentDialog();
        }
        GUI.enabled = true;
        if (GUILayout.Button("Grant Consent", new GUILayoutOption[0]))
        {
            MoPubAndroid.PartnerApi.GrantConsent();
        }
        if (GUILayout.Button("Revoke Consent", new GUILayoutOption[0]))
        {
            MoPubAndroid.PartnerApi.RevokeConsent();
        }
        GUI.enabled = true;
        GUILayout.EndHorizontal();
    }