From 8ed284d03f6d557ec901ff0cdda5e5bba4bb3c07 Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Tue, 15 Apr 2025 13:52:21 -0500 Subject: [PATCH 01/11] Added other ad types / fixed APS around it. GUI is next. --- .../ThirdPartyDemand/APS/ApsAndroid.cs | 21 ++++++++++++------- .../ThirdPartyDemand/APS/ApsIOS.cs | 20 +++++++++++------- .../Nimbus.Internal/NimbusAdUnityType.cs | 7 ++++++- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs index 47eed313..e0f53b46 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs @@ -33,7 +33,8 @@ public void InitializeNativeSDK() { _aps.CallStatic("initialize", _currentActivity, _appID); foreach (var slot in _slotData) { var (w, h) = AdTypeToDim(slot.AdUnitType); - if (slot.AdUnitType == AdUnitType.Rewarded) { + if (slot.AdUnitType == AdUnitType.InterstitialVideo || + slot.AdUnitType == AdUnitType.Rewarded) { _aps.CallStatic("addApsSlot", slot.SlotId, w, h, true); continue; } @@ -48,12 +49,16 @@ public void InitializeNativeSDK() { private static Tuple AdTypeToDim(AdUnitType type) { switch (type) { - case AdUnitType.Undefined: - return new Tuple(0, 0); - case AdUnitType.Banner: + case AdUnitType.Banner320X50: return new Tuple(320, 50); - case AdUnitType.Interstitial: - return new Tuple(320, 480); + case AdUnitType.Banner300X250: + return new Tuple(300, 250); + case AdUnitType.Banner728X90: + return new Tuple(728, 90); + case AdUnitType.InterstitialDisplay: + return new Tuple(Screen.width, Screen.height); + case AdUnitType.InterstitialVideo: + return new Tuple(Screen.width, Screen.height); case AdUnitType.Rewarded: return new Tuple(Screen.width, Screen.height); default: @@ -76,9 +81,9 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen return null; } - var (w, h) = AdTypeToDim(type); - if (type == AdUnitType.Rewarded) { + if (type == AdUnitType.InterstitialDisplay || type == AdUnitType.InterstitialVideo || + type == AdUnitType.Rewarded) { w = 0; h = 0; isFullScreen = true; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs index 2ae85d3b..2de3a817 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs @@ -41,7 +41,8 @@ public void InitializeNativeSDK() { foreach (var slot in _slotData) { var (w, h) = AdTypeToDim(slot.AdUnitType); - if (slot.AdUnitType == AdUnitType.Rewarded) { + if (slot.AdUnitType == AdUnitType.InterstitialVideo || + slot.AdUnitType == AdUnitType.Rewarded) { _addAPSSlot(slot.SlotId, w, h, true); continue; } @@ -52,12 +53,16 @@ public void InitializeNativeSDK() { private static Tuple AdTypeToDim(AdUnitType type) { switch (type) { - case AdUnitType.Undefined: - return new Tuple(0, 0); - case AdUnitType.Banner: + case AdUnitType.Banner320X50: return new Tuple(320, 50); - case AdUnitType.Interstitial: - return new Tuple(320, 480); + case AdUnitType.Banner300X250: + return new Tuple(300, 250); + case AdUnitType.Banner728X90: + return new Tuple(728, 90); + case AdUnitType.InterstitialDisplay: + return new Tuple(Screen.width, Screen.height); + case AdUnitType.InterstitialVideo: + return new Tuple(Screen.width, Screen.height); case AdUnitType.Rewarded: return new Tuple(Screen.width, Screen.height); default: @@ -82,7 +87,8 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen var (w, h) = AdTypeToDim(type); // ReSharper disable once InvertIf - if (type == AdUnitType.Rewarded) { + if (type == AdUnitType.InterstitialDisplay || type == AdUnitType.InterstitialVideo || + type == AdUnitType.Rewarded) { w = 0; h = 0; isFullScreen = true; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs index 320ba69c..62f75b2b 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs @@ -10,7 +10,12 @@ public enum AdUnitType : byte { Undefined = 0, Banner = 1, Interstitial = 2, - Rewarded = 3 + Rewarded = 3, + Banner320X50 = 4, + Banner300X250 = 5, + Banner728X90 = 6, + InterstitialDisplay = 7, + InterstitialVideo = 8 } From f9fcbebaa7d68c2314c735c62b1dccdc5898f4d4 Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Wed, 16 Apr 2025 09:20:58 -0500 Subject: [PATCH 02/11] Added different property for APS, need to test. --- .../Editor/NimbusManagerCreator.cs | 18 ++--- .../Interceptor/IInterceptor.cs | 2 +- .../Interceptor/SkAdNetworkIOS.cs | 2 +- .../ThirdPartyDemand/APS/ApsAndroid.cs | 66 ++++++++++++----- .../ThirdPartyDemand/APS/ApsIOS.cs | 70 +++++++++++++------ .../ThirdPartyDemand/APS/ApsSlotData.cs | 11 ++- .../ThirdPartyDemand/AdMob/AdMobAndroid.cs | 2 +- .../ThirdPartyDemand/AdMob/AdMobIOS.cs | 2 +- .../ThirdPartyDemand/Meta/MetaAndroid.cs | 2 +- .../ThirdPartyDemand/Meta/MetaIOS.cs | 2 +- .../Mintegral/MintegralAndroid.cs | 2 +- .../Mintegral/MintegralIOS.cs | 2 +- .../MobileFuse/MobileFuseAndroid.cs | 2 +- .../MobileFuse/MobileFuseIOS.cs | 2 +- .../UnityAds/UnityAdsAndroid.cs | 2 +- .../ThirdPartyDemand/UnityAds/UnityAdsIOS.cs | 2 +- .../ThirdPartyDemand/Vungle/VungleAndroid.cs | 2 +- .../ThirdPartyDemand/Vungle/VungleIOS.cs | 2 +- .../Nimbus.Internal/NimbusAdUnityType.cs | 5 -- .../Scripts/Nimbus.Tests/InterceptorTest.cs | 6 +- .../Runtime/Scripts/NimbusManager.cs | 13 +++- 21 files changed, 139 insertions(+), 78 deletions(-) diff --git a/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs b/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs index 924c03b6..6d877f3c 100644 --- a/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs +++ b/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs @@ -634,9 +634,9 @@ private void HandleApsSlots(SerializedProperty slotData, out ApsSlotData[] platf SlotId = slotId?.stringValue }; - var adUnitType = item.FindPropertyRelative("AdUnitType"); + var adUnitType = item.FindPropertyRelative("APSAdUnitType"); if (adUnitType != null) { - apsData.AdUnitType = (AdUnitType)adUnitType.enumValueIndex; + apsData.APSAdUnitType = (APSAdUnitType)adUnitType.enumValueIndex; } apsSlotData.Add(apsData); @@ -657,7 +657,7 @@ private bool ValidateApsData(string platform, SerializedProperty appId, ApsSlotD return false; } - var seenAdTypes = new Dictionary(); + var seenAdTypes = new Dictionary(); foreach (var apsSlot in slotData) { if (apsSlot.SlotId.IsNullOrEmpty()) { Debug.unityLogger.LogError("Nimbus", @@ -665,18 +665,12 @@ private bool ValidateApsData(string platform, SerializedProperty appId, ApsSlotD return false; } - if (apsSlot.AdUnitType == AdUnitType.Undefined) { - Debug.unityLogger.LogError("Nimbus", - $"APS SDK has been included, Ad Unit type for {platform} cannot be Undefined, object NimbusAdsManager not created"); - return false; - } - - if (!seenAdTypes.ContainsKey(apsSlot.AdUnitType)) { - seenAdTypes.Add(apsSlot.AdUnitType, true); + if (!seenAdTypes.ContainsKey(apsSlot.APSAdUnitType)) { + seenAdTypes.Add(apsSlot.APSAdUnitType, true); } else { Debug.unityLogger.LogError("Nimbus", - $"APS SDK has been included, APS cannot contain duplicate ad type {apsSlot.AdUnitType} for {platform}, object NimbusAdsManager not created"); + $"APS SDK has been included, APS cannot contain duplicate ad type {apsSlot.APSAdUnitType} for {platform}, object NimbusAdsManager not created"); return false; } } diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/IInterceptor.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/IInterceptor.cs index 0af26b9b..bb84df5b 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/IInterceptor.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/IInterceptor.cs @@ -2,7 +2,7 @@ namespace Nimbus.Internal.Interceptor { public interface IInterceptor { - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen); + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0); public BidRequest ModifyRequest(BidRequest bidRequest, string data); } } \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/SkAdNetworkIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/SkAdNetworkIOS.cs index 879d6372..f3b8820e 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/SkAdNetworkIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/SkAdNetworkIOS.cs @@ -30,7 +30,7 @@ public SkAdNetworkIOS(string rawPlistJson) { } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) { + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { return ""; } diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs index e0f53b46..fc08f65e 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs @@ -32,9 +32,9 @@ public void InitializeNativeSDK() { _aps = new AndroidJavaClass(AndroidApsPackage); _aps.CallStatic("initialize", _currentActivity, _appID); foreach (var slot in _slotData) { - var (w, h) = AdTypeToDim(slot.AdUnitType); - if (slot.AdUnitType == AdUnitType.InterstitialVideo || - slot.AdUnitType == AdUnitType.Rewarded) { + var (w, h) = AdTypeToDim(slot.APSAdUnitType); + if (slot.APSAdUnitType == APSAdUnitType.InterstitialVideo || + slot.APSAdUnitType == APSAdUnitType.RewardedVideo) { _aps.CallStatic("addApsSlot", slot.SlotId, w, h, true); continue; } @@ -47,19 +47,19 @@ public void InitializeNativeSDK() { adRegistration.CallStatic("enableTesting", true); } - private static Tuple AdTypeToDim(AdUnitType type) { + private static Tuple AdTypeToDim(APSAdUnitType type) { switch (type) { - case AdUnitType.Banner320X50: + case APSAdUnitType.Display320X50: return new Tuple(320, 50); - case AdUnitType.Banner300X250: + case APSAdUnitType.Display300X250: return new Tuple(300, 250); - case AdUnitType.Banner728X90: + case APSAdUnitType.Display728X90: return new Tuple(728, 90); - case AdUnitType.InterstitialDisplay: + case APSAdUnitType.InterstitialDisplay: return new Tuple(Screen.width, Screen.height); - case AdUnitType.InterstitialVideo: + case APSAdUnitType.InterstitialVideo: return new Tuple(Screen.width, Screen.height); - case AdUnitType.Rewarded: + case APSAdUnitType.RewardedVideo: return new Tuple(Screen.width, Screen.height); default: return new Tuple(0, 0); @@ -67,22 +67,50 @@ private static Tuple AdTypeToDim(AdUnitType type) { } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) { + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; - // ReSharper disable once ForCanBeConvertedToForeach - // ReSharper disable once LoopCanBeConvertedToQuery - for (var i = 0; i < _slotData.Length; i++) { - if (_slotData[i].AdUnitType != type) continue; - found = true; + + foreach (ApsSlotData slot in _slotData){ + if (type == AdUnitType.Banner) + { + if (width == 320 && height == 50 && slot.APSAdUnitType == APSAdUnitType.Display320X50) + { + found = true; + } + if (width == 300 && height == 250 && slot.APSAdUnitType == APSAdUnitType.Display300X250) + { + found = true; + } + if (width == 728 && height == 90 && slot.APSAdUnitType == APSAdUnitType.Display728X90) + { + found = true; + } + } + else if (type == AdUnitType.Interstitial) + { + if (slot.APSAdUnitType == APSAdUnitType.InterstitialDisplay || + slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) + { + found = true; + } + } + else + { + if (slot.APSAdUnitType == APSAdUnitType.RewardedVideo) + { + found = true; + } + } break; } if (!found) { return null; } - - var (w, h) = AdTypeToDim(type); - if (type == AdUnitType.InterstitialDisplay || type == AdUnitType.InterstitialVideo || + + var w = width; + var h = height; + if (type == AdUnitType.Interstitial || type == AdUnitType.Rewarded) { w = 0; h = 0; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs index 2de3a817..82333d3c 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs @@ -40,9 +40,9 @@ public void InitializeNativeSDK() { _initializeAPSRequestHelper(_appID, TimeoutInSeconds, _enableTestMode); foreach (var slot in _slotData) { - var (w, h) = AdTypeToDim(slot.AdUnitType); - if (slot.AdUnitType == AdUnitType.InterstitialVideo || - slot.AdUnitType == AdUnitType.Rewarded) { + var (w, h) = AdTypeToDim(slot.APSAdUnitType); + if (slot.APSAdUnitType == APSAdUnitType.InterstitialVideo || + slot.APSAdUnitType == APSAdUnitType.RewardedVideo) { _addAPSSlot(slot.SlotId, w, h, true); continue; } @@ -51,44 +51,70 @@ public void InitializeNativeSDK() { } } - private static Tuple AdTypeToDim(AdUnitType type) { + private static Tuple AdTypeToDim(APSAdUnitType type) { switch (type) { - case AdUnitType.Banner320X50: + case APSAdUnitType.Display320X50: return new Tuple(320, 50); - case AdUnitType.Banner300X250: + case APSAdUnitType.Display300X250: return new Tuple(300, 250); - case AdUnitType.Banner728X90: + case APSAdUnitType.Display728X90: return new Tuple(728, 90); - case AdUnitType.InterstitialDisplay: + case APSAdUnitType.InterstitialDisplay: return new Tuple(Screen.width, Screen.height); - case AdUnitType.InterstitialVideo: + case APSAdUnitType.InterstitialVideo: return new Tuple(Screen.width, Screen.height); - case AdUnitType.Rewarded: + case APSAdUnitType.RewardedVideo: return new Tuple(Screen.width, Screen.height); default: return new Tuple(0, 0); } } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) { + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; - // ReSharper disable once ForCanBeConvertedToForeach - // ReSharper disable once LoopCanBeConvertedToQuery - for (var i = 0; i < _slotData.Length; i++) { - if (_slotData[i].AdUnitType != type) continue; - found = true; + + foreach (ApsSlotData slot in _slotData){ + if (type == AdUnitType.Banner) + { + if (width == 320 && height == 50 && slot.APSAdUnitType == APSAdUnitType.Display320X50) + { + found = true; + } + if (width == 300 && height == 250 && slot.APSAdUnitType == APSAdUnitType.Display300X250) + { + found = true; + } + if (width == 728 && height == 90 && slot.APSAdUnitType == APSAdUnitType.Display728X90) + { + found = true; + } + } + else if (type == AdUnitType.Interstitial) + { + if (slot.APSAdUnitType == APSAdUnitType.InterstitialDisplay || + slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) + { + found = true; + } + } + else + { + if (slot.APSAdUnitType == APSAdUnitType.RewardedVideo) + { + found = true; + } + } break; } - + if (!found) { return null; } - - var (w, h) = AdTypeToDim(type); - // ReSharper disable once InvertIf - if (type == AdUnitType.InterstitialDisplay || type == AdUnitType.InterstitialVideo || - type == AdUnitType.Rewarded) { + var w = width; + var h = height; + if (type == AdUnitType.Interstitial || + type == AdUnitType.Rewarded) { w = 0; h = 0; isFullScreen = true; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsSlotData.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsSlotData.cs index b994b915..19601506 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsSlotData.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsSlotData.cs @@ -1,9 +1,18 @@ using System; +using UnityEngine; namespace Nimbus.Internal.Interceptor.ThirdPartyDemand { [Serializable] public class ApsSlotData { public string SlotId; - public AdUnitType AdUnitType; + public APSAdUnitType APSAdUnitType; + } + public enum APSAdUnitType : byte { + Display320X50 = 0, + Display300X250 = 1, + Display728X90 = 2, + InterstitialDisplay = 3, + InterstitialVideo = 4, + RewardedVideo = 5 } } \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobAndroid.cs index af0d64f0..08b13998 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobAndroid.cs @@ -29,7 +29,7 @@ public void InitializeNativeSDK() { //do nothing } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) { + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { foreach (ThirdPartyAdUnit adUnit in _adUnitIds) { if (adUnit.AdUnitType == type) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobIOS.cs index 537b819b..c6fdd83d 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/AdMob/AdMobIOS.cs @@ -47,7 +47,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { foreach (ThirdPartyAdUnit adUnit in _adUnitIds) { diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaAndroid.cs index 1abc46c8..89161f65 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaAndroid.cs @@ -33,7 +33,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var meta = new AndroidJavaClass(NimbusMetaPackage); var buyerId = meta.GetStatic("bidderToken"); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaIOS.cs index c40afa6b..fa4327e3 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Meta/MetaIOS.cs @@ -36,7 +36,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var biddingToken = _fetchMetaBiddingToken(); Debug.unityLogger.Log("METABIDDINGTOKEN", biddingToken); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralAndroid.cs index 89aa8e08..fc9ac571 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralAndroid.cs @@ -48,7 +48,7 @@ public void InitializeNativeSDK() { } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) { + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { foreach (ThirdPartyAdUnit adUnit in _adUnitIds) { if (adUnit.AdUnitType == type) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralIOS.cs index 7a6bfcad..0050d58f 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Mintegral/MintegralIOS.cs @@ -51,7 +51,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { foreach (ThirdPartyAdUnit adUnit in _adUnitIds) { diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseAndroid.cs index 49d18c34..afd62475 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseAndroid.cs @@ -24,7 +24,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var token = ""; try diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseIOS.cs index 9915307a..4fb78a6b 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/MobileFuse/MobileFuseIOS.cs @@ -29,7 +29,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var biddingToken = _fetchMobileFuseToken(); Debug.unityLogger.Log("MobileFuse Token", biddingToken); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsAndroid.cs index 30df3d2a..65ef619d 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsAndroid.cs @@ -23,7 +23,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var unityAds = new AndroidJavaClass(UnityAdsPackage); var token = unityAds.CallStatic("getToken"); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsIOS.cs index 9d9d5497..013c86fd 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/UnityAds/UnityAdsIOS.cs @@ -28,7 +28,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var biddingToken = _fetchUnityAdsToken(); Debug.unityLogger.Log("Unity Token", biddingToken); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleAndroid.cs index 8c09b77c..270782b1 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleAndroid.cs @@ -35,7 +35,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var vungle = new AndroidJavaClass(VunglePackage); var buyerId = vungle.CallStatic("getBiddingToken", _applicationContext); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleIOS.cs index 371c4b71..cdac06d9 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/Vungle/VungleIOS.cs @@ -37,7 +37,7 @@ public BidRequest ModifyRequest(BidRequest bidRequest, string data) { return bidRequest; } - public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen) + public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var buyerId = _fetchVungleBuyerId(); Debug.unityLogger.Log("VUNGLEBUYER", buyerId); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs index 62f75b2b..5851a958 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs @@ -11,11 +11,6 @@ public enum AdUnitType : byte { Banner = 1, Interstitial = 2, Rewarded = 3, - Banner320X50 = 4, - Banner300X250 = 5, - Banner728X90 = 6, - InterstitialDisplay = 7, - InterstitialVideo = 8 } diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs index 1f1344e9..7e04a4d7 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs @@ -163,15 +163,15 @@ public void TestMultipleInterceptor() { new[] { new ApsSlotData { SlotId = "rewarded_video_slot", - AdUnitType = AdUnitType.Rewarded, + APSAdUnitType = APSAdUnitType.RewardedVideo, }, new ApsSlotData { SlotId = "interstitial_slot", - AdUnitType = AdUnitType.Interstitial, + APSAdUnitType = APSAdUnitType.InterstitialDisplay, }, new ApsSlotData { SlotId = "banner_slot", - AdUnitType = AdUnitType.Banner, + APSAdUnitType = APSAdUnitType.Display320X50, } }) }; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs index 2989b3dc..e7ea6c6e 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs @@ -497,9 +497,18 @@ private BidRequest ApplyInterceptors(BidRequest bidRequest, AdUnitType adUnitTyp if (_nimbusPlatformAPI.Interceptors() == null) { return bidRequest; } - + var width = 0; + var height = 0; + if (!bidRequest.Imp.IsNullOrEmpty()) + { + if (bidRequest.Imp[0].Banner != null) + { + width = bidRequest.Imp[0].Banner.W ?? 0; + height = bidRequest.Imp[0].Banner.H ?? 0; + } + } foreach (var interceptor in _nimbusPlatformAPI.Interceptors()) { - var data = interceptor.GetProviderRtbDataFromNativeSDK(adUnitType, isFullScreen); + var data = interceptor.GetProviderRtbDataFromNativeSDK(adUnitType, isFullScreen, width, height); bidRequest = interceptor.ModifyRequest(bidRequest, data); } return bidRequest; From 6e6b26c3c6ed1478755e1a9b98f560b218ff0a89 Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Wed, 16 Apr 2025 11:37:03 -0500 Subject: [PATCH 03/11] Fixed break at incorrect point. --- .../Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs | 11 +++++++---- .../Interceptor/ThirdPartyDemand/APS/ApsIOS.cs | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs index fc08f65e..27ebb59d 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs @@ -69,39 +69,42 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; - foreach (ApsSlotData slot in _slotData){ if (type == AdUnitType.Banner) { if (width == 320 && height == 50 && slot.APSAdUnitType == APSAdUnitType.Display320X50) { found = true; + break; } if (width == 300 && height == 250 && slot.APSAdUnitType == APSAdUnitType.Display300X250) { found = true; + break; } if (width == 728 && height == 90 && slot.APSAdUnitType == APSAdUnitType.Display728X90) { found = true; + break; } } - else if (type == AdUnitType.Interstitial) + if (type == AdUnitType.Interstitial) { if (slot.APSAdUnitType == APSAdUnitType.InterstitialDisplay || slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) { found = true; + break; } } - else + if (type == AdUnitType.Rewarded) { if (slot.APSAdUnitType == APSAdUnitType.RewardedVideo) { found = true; + break; } } - break; } if (!found) { diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs index 82333d3c..c872ace5 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs @@ -72,39 +72,42 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; - foreach (ApsSlotData slot in _slotData){ if (type == AdUnitType.Banner) { if (width == 320 && height == 50 && slot.APSAdUnitType == APSAdUnitType.Display320X50) { found = true; + break; } if (width == 300 && height == 250 && slot.APSAdUnitType == APSAdUnitType.Display300X250) { found = true; + break; } if (width == 728 && height == 90 && slot.APSAdUnitType == APSAdUnitType.Display728X90) { found = true; + break; } } - else if (type == AdUnitType.Interstitial) + if (type == AdUnitType.Interstitial) { if (slot.APSAdUnitType == APSAdUnitType.InterstitialDisplay || slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) { found = true; + break; } } - else + if (type == AdUnitType.Rewarded) { if (slot.APSAdUnitType == APSAdUnitType.RewardedVideo) { found = true; + break; } } - break; } if (!found) { From a205cab4b282dec9a88e0eecd7cd87c1506d6542 Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Wed, 16 Apr 2025 17:07:55 -0500 Subject: [PATCH 04/11] Fixes for APS on iOS. --- .../Runtime/Plugins/iOS/NimbusManager.swift | 20 ++++++++++--------- .../ThirdPartyDemand/APS/ApsIOS.cs | 4 +++- .../LiveRamp/NimbusLiveRampHelpers.cs | 4 +++- .../Scripts/Nimbus.Tests/InterceptorTest.cs | 12 +++++------ 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift b/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift index c66ef489..3864f364 100644 --- a/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift +++ b/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift @@ -431,13 +431,15 @@ extension DispatchGroup { } } -extension LREnvelope { - // This helper decodes Pair IDs from LiveRamp envelope - var pairIds: [String]? { - guard let envelope25, let decodedPair = Data(base64Encoded: envelope25), - let pairIds = try? JSONSerialization.jsonObject(with: decodedPair) as? [String] - else { return nil } - - return pairIds +#if NIMBUS_ENABLE_LIVERAMP + extension LREnvelope { + // This helper decodes Pair IDs from LiveRamp envelope + var pairIds: [String]? { + guard let envelope25, let decodedPair = Data(base64Encoded: envelope25), + let pairIds = try? JSONSerialization.jsonObject(with: decodedPair) as? [String] + else { return nil } + + return pairIds + } } -} +#endif \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs index c872ace5..e4287b8a 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs @@ -72,6 +72,7 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; + var interstitialVideo = false; foreach (ApsSlotData slot in _slotData){ if (type == AdUnitType.Banner) { @@ -97,6 +98,7 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) { found = true; + interstitialVideo = (slot.APSAdUnitType == APSAdUnitType.InterstitialVideo); break; } } @@ -116,7 +118,7 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen var w = width; var h = height; - if (type == AdUnitType.Interstitial || + if (interstitialVideo || type == AdUnitType.Rewarded) { w = 0; h = 0; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs index 2b6e2190..71d0b78d 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs @@ -9,9 +9,10 @@ namespace Nimbus.Internal.LiveRamp { + #if NIMBUS_ENABLE_LIVERAMP public class NimbusLiveRampHelpers { - #if UNITY_IOS + #if UNITY_IOS [DllImport("__Internal")] private static extern void _initializeLiveRamp(String configId, String email, String phoneNumber, Boolean isTestMode, Boolean hasConsentForNoLegislation); @@ -70,6 +71,7 @@ public static BidRequest addLiveRampToRequest(BidRequest bidRequest) return bidRequest; } } +#endif } \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs index 7e04a4d7..e907ad87 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Tests/InterceptorTest.cs @@ -39,15 +39,15 @@ public void TestApsInterceptor() { new[] { new ApsSlotData { SlotId = "rewarded_video_slot", - AdUnitType = AdUnitType.Rewarded, + APSAdUnitType = APSAdUnitType.RewardedVideo, }, new ApsSlotData { SlotId = "interstitial_slot", - AdUnitType = AdUnitType.Interstitial, + APSAdUnitType = APSAdUnitType.InterstitialDisplay, }, new ApsSlotData { SlotId = "banner_slot", - AdUnitType = AdUnitType.Banner, + APSAdUnitType = APSAdUnitType.Display320X50, } }) ), @@ -75,15 +75,15 @@ public void TestApsInterceptor() { new[] { new ApsSlotData { SlotId = "rewarded_video_slot", - AdUnitType = AdUnitType.Rewarded, + APSAdUnitType = APSAdUnitType.RewardedVideo, }, new ApsSlotData { SlotId = "interstitial_slot", - AdUnitType = AdUnitType.Interstitial, + APSAdUnitType = APSAdUnitType.InterstitialDisplay, }, new ApsSlotData { SlotId = "banner_slot", - AdUnitType = AdUnitType.Banner, + APSAdUnitType = APSAdUnitType.Display320X50, } }) ), From 503504a1778f8949462a9fc108575823bc42a0ad Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 09:35:36 -0500 Subject: [PATCH 05/11] Made a couple fixes including a GUI error. --- .../ThirdPartyDemand/APS/ApsIOS.cs | 4 +- .../NimbusSDKConfigurationPropertiesEditor.cs | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs index e4287b8a..c872ace5 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs @@ -72,7 +72,6 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; - var interstitialVideo = false; foreach (ApsSlotData slot in _slotData){ if (type == AdUnitType.Banner) { @@ -98,7 +97,6 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) { found = true; - interstitialVideo = (slot.APSAdUnitType == APSAdUnitType.InterstitialVideo); break; } } @@ -118,7 +116,7 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen var w = width; var h = height; - if (interstitialVideo || + if (type == AdUnitType.Interstitial || type == AdUnitType.Rewarded) { w = 0; h = 0; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.ScriptableObjects/NimbusSDKConfigurationPropertiesEditor.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.ScriptableObjects/NimbusSDKConfigurationPropertiesEditor.cs index f662f6b1..7269c7d6 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.ScriptableObjects/NimbusSDKConfigurationPropertiesEditor.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.ScriptableObjects/NimbusSDKConfigurationPropertiesEditor.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.IO; using System.Text; +using Nimbus.Internal.Interceptor.ThirdPartyDemand; +using Nimbus.Internal.Utility; using UnityEngine; using UnityEditor; using UnityEditorInternal; @@ -59,6 +61,9 @@ public class NimbusSDKConfigurationPropertiesEditor : Editor { private SerializedProperty _iosUnityAdsGameId; + // Needed so error messages aren't spammed + private bool _errorLogged; + private void OnEnable() { _publisherKey = serializedObject.FindProperty("publisherKey"); _apiKey = serializedObject.FindProperty("apiKey"); @@ -356,11 +361,13 @@ public override void OnInspectorGUI() { #endif #endif + #if NIMBUS_ENABLE_APS_ANDROID || NIMBUS_ENABLE_APS_IOS EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray, 2); GUILayout.Space(10); EditorGUILayout.LabelField("APS Configuration", headerStyle); #if NIMBUS_ENABLE_APS_ANDROID + ValidateApsSlots("Android", _androidApsSlots); GUILayout.Space(10); EditorGUILayout.PropertyField((_androidAppId)); EditorDrawUtility.DrawEditorLayoutHorizontalLine(Color.gray); @@ -498,6 +505,42 @@ public override void OnInspectorGUI() { serializedObject.ApplyModifiedProperties(); } + + private void ValidateApsSlots(string platform, SerializedProperty slotData) { + var apsSlotData = new List(); + for (var i = 0; i < slotData.arraySize; i++) { + var item = slotData.GetArrayElementAtIndex(i); + var slotId = item.FindPropertyRelative("SlotId"); + + var apsData = new ApsSlotData { + SlotId = slotId?.stringValue + }; + + var adUnitType = item.FindPropertyRelative("APSAdUnitType"); + if (adUnitType != null) { + apsData.APSAdUnitType = (APSAdUnitType)adUnitType.enumValueIndex; + } + + apsSlotData.Add(apsData); + } + var platformSlots = apsSlotData.ToArray(); + var seenAdTypes = new Dictionary(); + foreach (var apsSlot in platformSlots) { + if (!seenAdTypes.ContainsKey(apsSlot.APSAdUnitType)) { + seenAdTypes.Add(apsSlot.APSAdUnitType, true); + } + else { + if (!_errorLogged) + { + Debug.unityLogger.LogError("Nimbus", + $"APS SDK has been included, APS cannot contain duplicate ad type {apsSlot.APSAdUnitType} for {platform}, object NimbusAdsManager not created"); + _errorLogged = true; + } + return; + } + } + _errorLogged = false; + } } } #endif \ No newline at end of file From a2b3d33df91bfe951f610992f1a7267eac234732 Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 11:04:10 -0500 Subject: [PATCH 06/11] Last changes for APS --- .../Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs | 11 +++++++---- .../Interceptor/ThirdPartyDemand/APS/ApsIOS.cs | 7 ++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs index 27ebb59d..12fd5657 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsAndroid.cs @@ -56,9 +56,9 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { case APSAdUnitType.Display728X90: return new Tuple(728, 90); case APSAdUnitType.InterstitialDisplay: - return new Tuple(Screen.width, Screen.height); + return new Tuple(320, 480); case APSAdUnitType.InterstitialVideo: - return new Tuple(Screen.width, Screen.height); + return new Tuple(320, 480); case APSAdUnitType.RewardedVideo: return new Tuple(Screen.width, Screen.height); default: @@ -69,6 +69,7 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; + var interstitialVideo = false; foreach (ApsSlotData slot in _slotData){ if (type == AdUnitType.Banner) { @@ -94,6 +95,7 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) { found = true; + interstitialVideo = (slot.APSAdUnitType == APSAdUnitType.InterstitialVideo); break; } } @@ -108,13 +110,14 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen } if (!found) { + Debug.unityLogger.LogError("Nimbus", + "APS NOT FOUND"); return null; } var w = width; var h = height; - if (type == AdUnitType.Interstitial || - type == AdUnitType.Rewarded) { + if (interstitialVideo || type == AdUnitType.Rewarded) { w = 0; h = 0; isFullScreen = true; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs index c872ace5..1d1cb45b 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Interceptor/ThirdPartyDemand/APS/ApsIOS.cs @@ -60,7 +60,7 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { case APSAdUnitType.Display728X90: return new Tuple(728, 90); case APSAdUnitType.InterstitialDisplay: - return new Tuple(Screen.width, Screen.height); + return new Tuple(320, 480); case APSAdUnitType.InterstitialVideo: return new Tuple(Screen.width, Screen.height); case APSAdUnitType.RewardedVideo: @@ -72,6 +72,7 @@ private static Tuple AdTypeToDim(APSAdUnitType type) { public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen, int width=0, int height=0) { var found = false; + var interstitialVideo = false; foreach (ApsSlotData slot in _slotData){ if (type == AdUnitType.Banner) { @@ -97,6 +98,7 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen slot.APSAdUnitType == APSAdUnitType.InterstitialVideo) { found = true; + interstitialVideo = (slot.APSAdUnitType == APSAdUnitType.InterstitialVideo); break; } } @@ -116,8 +118,7 @@ public string GetProviderRtbDataFromNativeSDK(AdUnitType type, bool isFullScreen var w = width; var h = height; - if (type == AdUnitType.Interstitial || - type == AdUnitType.Rewarded) { + if (interstitialVideo || type == AdUnitType.Rewarded) { w = 0; h = 0; isFullScreen = true; From 9837574f57d243db064702803f11a6097ee6f2cb Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 11:09:39 -0500 Subject: [PATCH 07/11] Fixing unnecessary changes. --- .../LiveRamp/NimbusLiveRampHelpers.cs | 106 +++++++++--------- .../Nimbus.Internal/NimbusAdUnityType.cs | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs index 71d0b78d..ba6b478a 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs @@ -10,68 +10,68 @@ namespace Nimbus.Internal.LiveRamp { #if NIMBUS_ENABLE_LIVERAMP - public class NimbusLiveRampHelpers - { - #if UNITY_IOS - [DllImport("__Internal")] - private static extern void _initializeLiveRamp(String configId, String email, - String phoneNumber, Boolean isTestMode, Boolean hasConsentForNoLegislation); - - [DllImport("__Internal")] - private static extern string _getLiveRampData(); - #endif - - public static void initializeLiveRamp(String configId, - Boolean hasConsentForNoLegislation, Boolean isTestMode, String email = "", - String phoneNumber = "") + public class NimbusLiveRampHelpers { #if UNITY_IOS - _initializeLiveRamp(configId, email, phoneNumber, isTestMode, hasConsentForNoLegislation); - #endif - #if UNITY_ANDROID - var liveRamp = new AndroidJavaClass("com.adsbynimbus.request.LiveRampExtension"); - if (isTestMode) - { - liveRamp.CallStatic("initializeTestMode", configId, email); - } - else - { - liveRamp.CallStatic("initialize", configId, email, phoneNumber, hasConsentForNoLegislation); - } - #endif - } + [DllImport("__Internal")] + private static extern void _initializeLiveRamp(String configId, String email, + String phoneNumber, Boolean isTestMode, Boolean hasConsentForNoLegislation); - public static BidRequest addLiveRampToRequest(BidRequest bidRequest) - { - var liveRampData = ""; - Eid[] eidsObject = {}; - #if UNITY_IOS - liveRampData = _getLiveRampData(); + [DllImport("__Internal")] + private static extern string _getLiveRampData(); #endif - #if UNITY_ANDROID - try - { - liveRampData = BridgeHelpers.GetStringFromJavaFuture( - "com.adsbynimbus.request.internal.NimbusRequestLiverampInternal", - "fetchLiverampEnvelope", new object[]{},500L); - } - catch (Exception e) + + public static void initializeLiveRamp(String configId, + Boolean hasConsentForNoLegislation, Boolean isTestMode, String email = "", + String phoneNumber = "") + { + #if UNITY_IOS + _initializeLiveRamp(configId, email, phoneNumber, isTestMode, hasConsentForNoLegislation); + #endif + #if UNITY_ANDROID + var liveRamp = new AndroidJavaClass("com.adsbynimbus.request.LiveRampExtension"); + if (isTestMode) + { + liveRamp.CallStatic("initializeTestMode", configId, email); + } + else + { + liveRamp.CallStatic("initialize", configId, email, phoneNumber, hasConsentForNoLegislation); + } + #endif + } + + public static BidRequest addLiveRampToRequest(BidRequest bidRequest) + { + var liveRampData = ""; + Eid[] eidsObject = {}; + #if UNITY_IOS + liveRampData = _getLiveRampData(); + #endif + #if UNITY_ANDROID + try + { + liveRampData = BridgeHelpers.GetStringFromJavaFuture( + "com.adsbynimbus.request.internal.NimbusRequestLiverampInternal", + "fetchLiverampEnvelope", new object[]{},500L); + } + catch (Exception e) + { + Debug.unityLogger.Log("LiveRamp Request Info ERROR", e.Message); + } + #endif + if (liveRampData.IsNullOrEmpty()) { - Debug.unityLogger.Log("LiveRamp Request Info ERROR", e.Message); + return bidRequest; } - #endif - if (liveRampData.IsNullOrEmpty()) - { + eidsObject = JsonConvert.DeserializeObject(liveRampData, typeof(Eid[])) as Eid[]; + bidRequest.User ??= new User(); + bidRequest.User.Ext ??= new UserExt(); + bidRequest.User.Ext.Eids = eidsObject; return bidRequest; } - eidsObject = JsonConvert.DeserializeObject(liveRampData, typeof(Eid[])) as Eid[]; - bidRequest.User ??= new User(); - bidRequest.User.Ext ??= new UserExt(); - bidRequest.User.Ext.Eids = eidsObject; - return bidRequest; } - } -#endif + #endif } \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs index 5851a958..320ba69c 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs @@ -10,7 +10,7 @@ public enum AdUnitType : byte { Undefined = 0, Banner = 1, Interstitial = 2, - Rewarded = 3, + Rewarded = 3 } From d9741a8cdc23bb73a6dc23e2987c8b08ac799e2e Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 11:13:28 -0500 Subject: [PATCH 08/11] Revert "Fixing unnecessary changes." This reverts commit 9837574f57d243db064702803f11a6097ee6f2cb. --- .../LiveRamp/NimbusLiveRampHelpers.cs | 106 +++++++++--------- .../Nimbus.Internal/NimbusAdUnityType.cs | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs index ba6b478a..71d0b78d 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs @@ -10,68 +10,68 @@ namespace Nimbus.Internal.LiveRamp { #if NIMBUS_ENABLE_LIVERAMP - public class NimbusLiveRampHelpers + public class NimbusLiveRampHelpers + { + #if UNITY_IOS + [DllImport("__Internal")] + private static extern void _initializeLiveRamp(String configId, String email, + String phoneNumber, Boolean isTestMode, Boolean hasConsentForNoLegislation); + + [DllImport("__Internal")] + private static extern string _getLiveRampData(); + #endif + + public static void initializeLiveRamp(String configId, + Boolean hasConsentForNoLegislation, Boolean isTestMode, String email = "", + String phoneNumber = "") { #if UNITY_IOS - [DllImport("__Internal")] - private static extern void _initializeLiveRamp(String configId, String email, - String phoneNumber, Boolean isTestMode, Boolean hasConsentForNoLegislation); - - [DllImport("__Internal")] - private static extern string _getLiveRampData(); + _initializeLiveRamp(configId, email, phoneNumber, isTestMode, hasConsentForNoLegislation); #endif + #if UNITY_ANDROID + var liveRamp = new AndroidJavaClass("com.adsbynimbus.request.LiveRampExtension"); + if (isTestMode) + { + liveRamp.CallStatic("initializeTestMode", configId, email); + } + else + { + liveRamp.CallStatic("initialize", configId, email, phoneNumber, hasConsentForNoLegislation); + } + #endif + } - public static void initializeLiveRamp(String configId, - Boolean hasConsentForNoLegislation, Boolean isTestMode, String email = "", - String phoneNumber = "") - { - #if UNITY_IOS - _initializeLiveRamp(configId, email, phoneNumber, isTestMode, hasConsentForNoLegislation); - #endif - #if UNITY_ANDROID - var liveRamp = new AndroidJavaClass("com.adsbynimbus.request.LiveRampExtension"); - if (isTestMode) - { - liveRamp.CallStatic("initializeTestMode", configId, email); - } - else - { - liveRamp.CallStatic("initialize", configId, email, phoneNumber, hasConsentForNoLegislation); - } - #endif - } - - public static BidRequest addLiveRampToRequest(BidRequest bidRequest) - { - var liveRampData = ""; - Eid[] eidsObject = {}; - #if UNITY_IOS - liveRampData = _getLiveRampData(); - #endif - #if UNITY_ANDROID - try - { - liveRampData = BridgeHelpers.GetStringFromJavaFuture( - "com.adsbynimbus.request.internal.NimbusRequestLiverampInternal", - "fetchLiverampEnvelope", new object[]{},500L); - } - catch (Exception e) - { - Debug.unityLogger.Log("LiveRamp Request Info ERROR", e.Message); - } - #endif - if (liveRampData.IsNullOrEmpty()) + public static BidRequest addLiveRampToRequest(BidRequest bidRequest) + { + var liveRampData = ""; + Eid[] eidsObject = {}; + #if UNITY_IOS + liveRampData = _getLiveRampData(); + #endif + #if UNITY_ANDROID + try + { + liveRampData = BridgeHelpers.GetStringFromJavaFuture( + "com.adsbynimbus.request.internal.NimbusRequestLiverampInternal", + "fetchLiverampEnvelope", new object[]{},500L); + } + catch (Exception e) { - return bidRequest; + Debug.unityLogger.Log("LiveRamp Request Info ERROR", e.Message); } - eidsObject = JsonConvert.DeserializeObject(liveRampData, typeof(Eid[])) as Eid[]; - bidRequest.User ??= new User(); - bidRequest.User.Ext ??= new UserExt(); - bidRequest.User.Ext.Eids = eidsObject; + #endif + if (liveRampData.IsNullOrEmpty()) + { return bidRequest; } + eidsObject = JsonConvert.DeserializeObject(liveRampData, typeof(Eid[])) as Eid[]; + bidRequest.User ??= new User(); + bidRequest.User.Ext ??= new UserExt(); + bidRequest.User.Ext.Eids = eidsObject; + return bidRequest; } - #endif + } +#endif } \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs index 320ba69c..5851a958 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs @@ -10,7 +10,7 @@ public enum AdUnitType : byte { Undefined = 0, Banner = 1, Interstitial = 2, - Rewarded = 3 + Rewarded = 3, } From b11fc8e5716dc3583429fbebe2ac537e7722d87d Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 11:14:12 -0500 Subject: [PATCH 09/11] Fixed 2 unnecessary changes. --- .../Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs | 2 +- .../Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs index 71d0b78d..65951fcc 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs @@ -12,7 +12,7 @@ namespace Nimbus.Internal.LiveRamp #if NIMBUS_ENABLE_LIVERAMP public class NimbusLiveRampHelpers { - #if UNITY_IOS + #if UNITY_IOS [DllImport("__Internal")] private static extern void _initializeLiveRamp(String configId, String email, String phoneNumber, Boolean isTestMode, Boolean hasConsentForNoLegislation); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs index 5851a958..320ba69c 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnityType.cs @@ -10,7 +10,7 @@ public enum AdUnitType : byte { Undefined = 0, Banner = 1, Interstitial = 2, - Rewarded = 3, + Rewarded = 3 } From 6c84a822a7800a015e25a9bfec4eea5b2c192a3c Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 11:21:45 -0500 Subject: [PATCH 10/11] Fixes --- .../Runtime/Plugins/iOS/NimbusManager.swift | 20 ++++++++++--------- .../LiveRamp/NimbusLiveRampHelpers.cs | 4 ---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift b/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift index c66ef489..3864f364 100644 --- a/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift +++ b/com.adsbynimbus.nimbus/Runtime/Plugins/iOS/NimbusManager.swift @@ -431,13 +431,15 @@ extension DispatchGroup { } } -extension LREnvelope { - // This helper decodes Pair IDs from LiveRamp envelope - var pairIds: [String]? { - guard let envelope25, let decodedPair = Data(base64Encoded: envelope25), - let pairIds = try? JSONSerialization.jsonObject(with: decodedPair) as? [String] - else { return nil } - - return pairIds +#if NIMBUS_ENABLE_LIVERAMP + extension LREnvelope { + // This helper decodes Pair IDs from LiveRamp envelope + var pairIds: [String]? { + guard let envelope25, let decodedPair = Data(base64Encoded: envelope25), + let pairIds = try? JSONSerialization.jsonObject(with: decodedPair) as? [String] + else { return nil } + + return pairIds + } } -} +#endif \ No newline at end of file diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs index e2960938..65951fcc 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs @@ -71,11 +71,7 @@ public static BidRequest addLiveRampToRequest(BidRequest bidRequest) return bidRequest; } } -<<<<<<< HEAD #endif -======= - #endif ->>>>>>> main } \ No newline at end of file From c094b71b1a89dfd88fdd9daf11574b6ce74b7aa4 Mon Sep 17 00:00:00 2001 From: Jonathan Sligh Date: Thu, 17 Apr 2025 11:22:37 -0500 Subject: [PATCH 11/11] one more --- .../Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs index 65951fcc..2a37e19f 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/LiveRamp/NimbusLiveRampHelpers.cs @@ -71,7 +71,7 @@ public static BidRequest addLiveRampToRequest(BidRequest bidRequest) return bidRequest; } } -#endif + #endif } \ No newline at end of file