using System.Collections.Generic; using System.Collections.ObjectModel; using Chartboost.Core.Initialization; using Chartboost.Logging; using UnityEngine.Scripting; namespace Chartboost.Core.Usercentrics { /// /// /// public class UsercentricsAdapter : NativeModuleWrapper { protected override string DefaultModuleId => "usercentrics"; protected override string DefaultModuleVersion => "1.0.22"; private readonly Dictionary _defaultTemplateIdToPartnerId = new() { { "J64M6DKwx", "adcolony" }, { "r7rvuoyDz", "admob" }, { "IUyljv4X5", "amazon_aps" }, { "fHczTMzX8", "applovin" }, { "IEbRp3saT", "chartboost" }, { "H17alcVo_iZ7", "fyber" }, { "S1_9Vsuj-Q", "google_googlebidding" }, { "ROCBK21nx", "hyprmx" }, { "ykdq8J5a9MExGT", "inmobi" }, { "VPSyZyTbYPSHpF", "mobilefuse" }, { "9dchbL797", "ironsource" }, { "ax0Nljnj2szF_r", "facebook" }, { "E6AgqirYV", "mintegral" }, { "HWSNU_Ll1", "pangle" }, { "B1DLe54jui-X", "tapjoy" }, { "hpb62D82I", "unity" }, { "5bv4OvSwoXKh-G", "verve" }, { "jk3jF2tpw", "vungle" }, { "EMD3qUMa8", "vungle" } }; /// /// Usercentrics CMP configuration. /// public UsercentricsOptions Options { get; } /// /// /// public IReadOnlyDictionary TemplateIdToPartnerId { get; } [Preserve] public UsercentricsAdapter(UsercentricsOptions options, IDictionary templateIdToPartnerId = null) : base(options, templateIdToPartnerId) { Options = options; if (templateIdToPartnerId == null) TemplateIdToPartnerId = _defaultTemplateIdToPartnerId; else { foreach (var defaultTemplateId in _defaultTemplateIdToPartnerId) { var key = defaultTemplateId.Key; var value = defaultTemplateId.Value; if (!templateIdToPartnerId.TryAdd(key, value)) LogController.Log($"Key: {key} is part of default template ids", LogLevel.Debug); } TemplateIdToPartnerId = new ReadOnlyDictionary(templateIdToPartnerId); } } } }