/// <summary> /// Saves the consent status with the given key into the persistent storage. /// </summary> /// <param name="key">Key.</param> /// <param name="consent">Consent.</param> public static void SaveConsent(string key, ConsentStatus consent) { var consentInt = consent == ConsentStatus.Unknown ? UnknownConsentStoredValue : consent == ConsentStatus.Revoked ? RevokedConsentStoredValue : GrantedConsentStoredValue; StorageUtil.SetInt(key, consentInt); }
// private string adUnitId; // private string appId; public void Start() { //npaSelected = false; //if (PlayerPrefs.HasKey("consentValue")) //{ // int thisValue = PlayerPrefs.GetInt("consentValue", 0); // if (thisValue == 0) // { // Advertising.GrantDataPrivacyConsent(); // npaSelected = false; // Debug.Log("personalized ads!"); // } // else // { // Advertising.RevokeDataPrivacyConsent(); // npaSelected = true; // Debug.Log("random ads!"); // } //} // Reads the current module-level consent of the Advertising module. ConsentStatus moduleConsent = Advertising.DataPrivacyConsent; Debug.Log("999 Consent status: " + moduleConsent); // Forward the consent to the Advertising module. //if (consent.advertisingConsent == ConsentStatus.Granted) // Advertising.GrantDataPrivacyConsent(); //else if (consent.advertisingConsent == ConsentStatus.Revoked) // Advertising.RevokeDataPrivacyConsent(); // Show banner ad Advertising.ShowBannerAd(BannerAdPosition.Bottom); }
public ConsentModel Create(Consent entity, ConsentStatus consentStatus) { var model = Create(entity); model.ConsentStatus = consentStatus; return(model); }
/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 26, Configuration.FieldSeparator), Id, SetIdCon.HasValue ? SetIdCon.Value.ToString(culture) : null, ConsentType?.ToDelimitedString(), ConsentFormIdAndVersion, ConsentFormNumber?.ToDelimitedString(), ConsentText != null ? string.Join(Configuration.FieldRepeatSeparator, ConsentText) : null, SubjectSpecificConsentText != null ? string.Join(Configuration.FieldRepeatSeparator, SubjectSpecificConsentText) : null, ConsentBackgroundInformation != null ? string.Join(Configuration.FieldRepeatSeparator, ConsentBackgroundInformation) : null, SubjectSpecificConsentBackgroundText != null ? string.Join(Configuration.FieldRepeatSeparator, SubjectSpecificConsentBackgroundText) : null, ConsenterImposedLimitations != null ? string.Join(Configuration.FieldRepeatSeparator, ConsenterImposedLimitations) : null, ConsentMode?.ToDelimitedString(), ConsentStatus?.ToDelimitedString(), ConsentDiscussionDateTime.HasValue ? ConsentDiscussionDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, ConsentDecisionDateTime.HasValue ? ConsentDecisionDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, ConsentEffectiveDateTime.HasValue ? ConsentEffectiveDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, ConsentEndDateTime.HasValue ? ConsentEndDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, SubjectCompetenceIndicator, TranslatorAssistanceIndicator, LanguageTranslatedTo?.ToDelimitedString(), InformationalMaterialSuppliedIndicator, ConsentBypassReason?.ToDelimitedString(), ConsentDisclosureLevel, ConsentNonDisclosureReason?.ToDelimitedString(), NonSubjectConsenterReason?.ToDelimitedString(), ConsenterId != null ? string.Join(Configuration.FieldRepeatSeparator, ConsenterId.Select(x => x.ToDelimitedString())) : null, RelationshipToSubject != null ? string.Join(Configuration.FieldRepeatSeparator, RelationshipToSubject.Select(x => x.ToDelimitedString())) : null ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_CHARTBOOST // If the consent is left as Unknown (maybe due to non-EEA region) // we won't do anything (pre-GDPR behaviour). switch (consent) { case ConsentStatus.Granted: Chartboost.setPIDataUseConsent(CBPIDataUseConsent.YesBehavioral); break; case ConsentStatus.Revoked: Chartboost.setPIDataUseConsent(CBPIDataUseConsent.NoBehavioral); break; case ConsentStatus.Unknown: Chartboost.setPIDataUseConsent(CBPIDataUseConsent.Unknown); break; default: break; } #else Debug.Log(NO_SDK_MESSAGE); #endif }
public Notification(ConsentArtefact consentDetail, string consentId, string signature, ConsentStatus status) { ConsentDetail = consentDetail; ConsentId = consentId; Signature = signature; Status = status; }
/// <summary> /// Finds the applicable data privacy consent for this module by searching /// upward from module-level consent to global-level consent (high priority -> low priority). /// </summary> /// <returns>The applicable data privacy consent.</returns> static ConsentStatus GetApplicableDataPrivacyConsent() { ConsentStatus localConsent = NotificationsConsentManager.Instance.DataPrivacyConsent; ConsentStatus globalConsent = GlobalConsentManager.Instance.DataPrivacyConsent; return(localConsent != ConsentStatus.Unknown ? localConsent : globalConsent); }
public void OnSuccess(ConsentStatus consentStatus, bool isNeedConsent, IList <AdProvider> adProviders) { Log.Debug(TAG, "ConsentStatus: " + consentStatus + ", isNeedConsent: " + isNeedConsent); // The parameter indicating whether the consent is required is returned. if (isNeedConsent) { // If ConsentStatus is set to Unknown, re-collect user consent. if (consentStatus == ConsentStatus.Unknown) { mAdProviders.Clear(); mAdProviders = adProviders; ShowConsentDialog(); } else { // If ConsentStatus is set to Personalized or NonPersonalized, no dialog box is displayed to collect user consent. LoadBannerAd(consentStatus.Value); } } else { // If a country does not require your app to collect user consent before displaying ads, your app can request a personalized ad directly. Log.Debug(TAG, "User is not need Consent"); LoadBannerAd(ConsentStatus.Personalized.Value); } }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_ADMOB mCurrentConsent = consent; #endif // See CreateAdMobAdRequest method for usage... }
internal static Notification Notification( ConsentStatus consentStatus = ConsentStatus.GRANTED) { return(new Notification(ConsentArtefact().Generate().Build(), faker.Random.Hash(), faker.Random.Hash(), consentStatus)); }
public ConsentArtefactRequest(string signature, ConsentArtefact consentDetail, ConsentStatus status, string consentId) { Signature = signature; ConsentDetail = consentDetail; Status = status; ConsentId = consentId; }
public async Task UpdateAsync(string consentArtefactId, ConsentStatus status) { var consentArtefact = await consentContext.ConsentArtefact .FirstOrDefaultAsync(c => c.ConsentArtefactId == consentArtefactId); consentArtefact.Status = status; await consentContext.SaveChangesAsync(); }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_ADCOLONY // If the client has been initialized, reconfigure it with new consent. // Otherwise, the consent will take effect during the first initialization. if (mIsInitialized) { Configure(); } #endif }
public TraderaAlias( Seller s, string alias, Guid consentId, ConsentStatus status) { Seller = s; Alias = alias; ConsentId = consentId; ConsentStatus = status; }
public void OnSuccess(ConsentStatus consentStatus, bool isNeedConsent, IList <AdProvider> adProviders) { Log.Info(TAG, "ConsentStatus: " + consentStatus + " , isNeedConsent: " + isNeedConsent); if (isNeedConsent) { if (adProviders != null && adProviders.Count > 0) { adProviderList = adProviders; } ShowConsentDialog(adProviderList); } }
async void ShouldUpdateConsentArtefact(ConsentStatus consentStatus) { SetupConsentNotification(consentStatus); await consentNotificationController.StoreConsent(consentNotification); consentRepository.Verify(cr => cr.UpdateAsync( consentNotification.Notification.ConsentId, consentStatus), Times.Once); consentRepository.Verify(cr => cr.AddAsync(It.IsAny <Consent>()), Times.Never); }
public Consent(string consentArtefactId, ConsentArtefact consentArtefact, string signature, ConsentStatus status, string consentManagerId) { ConsentArtefactId = consentArtefactId; ConsentArtefact = consentArtefact; Signature = signature; Status = status; ConsentManagerId = consentManagerId; }
/// <summary> /// Update the consent status. /// </summary> /// <param name="consentStatus"></param> private void UpdateConsentStatus(ConsentStatus consentStatus) { Consent.GetInstance(context).SetConsentStatus(consentStatus); //Save a user selection to the local SP. ISharedPreferences sharedPreferences = context.GetSharedPreferences(AdsConstant.SpName, FileCreationMode.Private); ISharedPreferencesEditor editor = sharedPreferences.Edit(); editor.PutInt(AdsConstant.SpConsentKey, consentStatus.Value).Commit(); //Callback activity if (callback != null) { callback.UpdateConsentStatus(consentStatus); } }
internal void SetConsentStatus(ConsentStatus consentStatus, String source) { ConsentData consentData = LoadConsentData(); if (consentStatus == ConsentStatus.UNKNOWN) { consentData.AdProviders = new HashSet <AdProvider>(); } else { consentData.ConsentedAdProviders = consentData.AdProviders; } consentData.ConsentSource = source; consentData.ConsentStatus = consentStatus; SaveConsentData(consentData); }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_APPLOVIN switch (consent) { case ConsentStatus.Granted: MaxSdk.SetHasUserConsent(true); break; case ConsentStatus.Revoked: MaxSdk.SetHasUserConsent(false); break; case ConsentStatus.Unknown: default: break; } #endif }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_IRONSOURCE switch (consent) { case ConsentStatus.Granted: IronSource.Agent.setConsent(true); break; case ConsentStatus.Revoked: IronSource.Agent.setConsent(false); break; case ConsentStatus.Unknown: default: break; } #endif }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_HEYZAP // Only set the GDPR consent if an explicit one is specified. switch (consent) { case ConsentStatus.Granted: HeyzapAds.SetGdprConsent(true); break; case ConsentStatus.Revoked: HeyzapAds.SetGdprConsent(false); break; case ConsentStatus.Unknown: default: break; } #endif }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_TAPJOY // https://ltv.tapjoy.com/sdk/api/csharp/class_tapjoy_unity_1_1_tapjoy.html#ad59030716ab973c1656d939315c81d74 switch (consent) { case ConsentStatus.Granted: Tapjoy.SetUserConsent("1"); break; case ConsentStatus.Revoked: Tapjoy.SetUserConsent("0"); break; case ConsentStatus.Unknown: default: break; } #endif }
public override void onSuccess(ConsentStatus arg0, bool isNeedConsent, List arg2) { TestTip.Inst.ShowText("ConsentUpdateListener onSuccess"); if (arg0 == ConsentStatus.UNKNOWN) { TestTip.Inst.ShowText("UNKNOWN"); } else if (arg0 == ConsentStatus.PERSONALIZED) { TestTip.Inst.ShowText("PERSONALIZED"); } else if (arg0 == ConsentStatus.NON_PERSONALIZED) { TestTip.Inst.ShowText("NON_PERSONALIZED"); } else { TestTip.Inst.ShowText("NON"); } }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if UNITY_ADS || UNITY_MONETIZATION // https://unityads.unity3d.com/help/legal/gdpr switch (consent) { case ConsentStatus.Granted: SetGdprMetadata(true); break; case ConsentStatus.Revoked: SetGdprMetadata(false); break; case ConsentStatus.Unknown: default: break; } #endif }
private void SetupConsentNotification(ConsentStatus consentStatus) { const string consentMangerId = "consentMangerId"; var notification = TestBuilder.Notification(consentStatus); var faker = new Faker(); consentNotification = new ConsentArtefactRepresentation(notification, DateTime.Now, faker.Random.Hash()); var consent = new Consent(notification.ConsentDetail.ConsentId, notification.ConsentDetail, notification.Signature, consentStatus, consentMangerId); consentRepository.Setup(x => x.AddAsync(consent)); consentRepository .Setup(x => x.GetFor(It.IsAny <string>())) .Returns(System.Threading.Tasks.Task.FromResult(consent)); }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_VUNGLE switch (consent) { case ConsentStatus.Granted: Vungle.updateConsentStatus(Vungle.Consent.Accepted); break; case ConsentStatus.Revoked: Vungle.updateConsentStatus(Vungle.Consent.Denied); break; case ConsentStatus.Unknown: Vungle.updateConsentStatus(Vungle.Consent.Undefined); break; default: break; } #endif }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_CHARTBOOST // If the consent is left as Unknown (maybe due to non-EEA region) // we won't do anything (pre-GDPR behaviour). switch (consent) { case ConsentStatus.Granted: Chartboost.restrictDataCollection(false); break; case ConsentStatus.Revoked: Chartboost.restrictDataCollection(true); break; case ConsentStatus.Unknown: default: break; } #else Debug.Log(NO_SDK_MESSAGE); #endif }
protected override void ApplyDataPrivacyConsent(ConsentStatus consent) { #if EM_MOPUB if (!MoPub.IsSdkInitialized) { return; // MoPub requires initialization before setting consent. } switch (consent) { case ConsentStatus.Granted: MoPub.PartnerApi.GrantConsent(); break; case ConsentStatus.Revoked: MoPub.PartnerApi.RevokeConsent(); break; case ConsentStatus.Unknown: default: break; } #endif }
public void UpdateConsentStatus(ConsentStatus consentStatus) { LoadBannerAd(consentStatus.Value); }