Esempio n. 1
0
        private static SpCcpaConsent UnwrapSpCcpaConsent(SpCcpaConsentWrapper wrappedCcpa)
        {
            //bool applies = ((JsonElement)wrappedCcpa.applies).GetBoolean();
            CcpaConsent consent = UnwrapCcpaConsent(wrappedCcpa.consents);

            return(new SpCcpaConsent(consent));
        }
Esempio n. 2
0
        private static SpCcpaConsent UnwrapSpCcpaConsentAndroid(CcpaConsentWrapper wrappedCcpa)
        {
            CcpaConsent unwrapped = new CcpaConsent(uuid: wrappedCcpa.uuid,
                                                    status: wrappedCcpa.status,
                                                    uspstring: wrappedCcpa.uspstring,
                                                    rejectedVendors: wrappedCcpa.rejectedVendors,
                                                    rejectedCategories: wrappedCcpa.rejectedCategories);

            return(new SpCcpaConsent(unwrapped));
        }
    public static void BroadcastIOnConsentReadyIfNeeded()
    {
        if (!CmpCampaignPopupQueue.IsCampaignAvailable &&
            (CmpLocalizationMapper.IsGdprConsented || CmpLocalizationMapper.IsCcpaConsented) &&
            (CmpLocalizationMapper.ccpaUserConsent != null || CmpLocalizationMapper.gdprUserConsent != null))
        {
            SpGdprConsent gdpr = null;
            SpCcpaConsent ccpa = null;
            if (CmpLocalizationMapper.IsGdprConsented &&
                CmpLocalizationMapper.gdprUserConsent != null &&
                CmpLocalizationMapper.gdprUserConsent.grants != null)
            {
                var gdprConsent = new GdprConsent();
                gdprConsent.euconsent = CmpLocalizationMapper.gdprUserConsent.euconsent;
                gdprConsent.TCData    = CmpLocalizationMapper.gdprUserConsent.TCData;
                gdprConsent.uuid      = CmpLocalizationMapper.gdprUserConsent.uuid;
                gdprConsent.grants    = new Dictionary <string, SpVendorGrant>();
                foreach (var kv in CmpLocalizationMapper.gdprUserConsent.grants)
                {
                    gdprConsent.grants[kv.Key] = new SpVendorGrant(kv.Value.purposeGrants);
                }

                gdpr = new SpGdprConsent(gdprConsent);
                CmpLocalizationMapper.gdprUserConsent = null;
            }
            if (CmpLocalizationMapper.IsCcpaConsented &&
                CmpLocalizationMapper.ccpaUserConsent != null)
            {
                CcpaConsent ccpaConsent = new CcpaConsent(uuid: CmpLocalizationMapper.ccpaUserConsent.uuid,
                                                          status: CmpLocalizationMapper.ccpaUserConsent.status,
                                                          uspstring: CmpLocalizationMapper.ccpaUserConsent.uspstring,
                                                          rejectedVendors: CmpLocalizationMapper.ccpaUserConsent.rejectedVendors,
                                                          rejectedCategories: CmpLocalizationMapper.ccpaUserConsent.rejectedCategories);
                ccpa = new SpCcpaConsent(ccpaConsent);
                CmpLocalizationMapper.ccpaUserConsent = null;
            }
            ConsentMessenger.Broadcast <IOnConsentReady>(new SpConsents(gdpr, ccpa));
        }
    }