diff --git a/com.adsbynimbus.nimbus/Editor/IOSPostBuildProcessor.cs b/com.adsbynimbus.nimbus/Editor/IOSPostBuildProcessor.cs index 8c2b1b32..ee1507aa 100644 --- a/com.adsbynimbus.nimbus/Editor/IOSPostBuildProcessor.cs +++ b/com.adsbynimbus.nimbus/Editor/IOSPostBuildProcessor.cs @@ -51,12 +51,12 @@ public static void OnPostprocessBuild(BuildTarget target, string path) { private static void CopyPodfile(string pathToBuiltProject) { var podfile = new IOSBuildDependencies(); var destPodfilePath = pathToBuiltProject + "/Podfile"; - Debug.Log($"Copying generating pod file to {destPodfilePath}"); + Debug.unityLogger.Log($"Copying generating pod file to {destPodfilePath}"); if (!File.Exists(destPodfilePath)) { File.WriteAllText(destPodfilePath, podfile.BuildDependencies()); } else { - Debug.Log("Podfile already exists"); + Debug.unityLogger.Log("Podfile already exists"); } } @@ -110,7 +110,7 @@ private static void AddSkaAdNetworkIdsToPlist(string path) { } } - Debug.Log($"Writing SkAdNetwork ids to {path}"); + Debug.unityLogger.Log($"Writing SkAdNetwork ids to {path}"); plist.WriteToFile(plistPath); } } diff --git a/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs b/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs index 48499d4e..0c4fbb13 100644 --- a/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs +++ b/com.adsbynimbus.nimbus/Editor/NimbusManagerCreator.cs @@ -168,12 +168,14 @@ private void OnGUI() { _asset.Sanitize(); if (_asset.apiKey.IsNullOrEmpty()) { - Debug.LogError("Apikey cannot be empty, object NimbusAdsManager not created"); + Debug.unityLogger.LogError("Nimbus", + "Apikey cannot be empty, object NimbusAdsManager not created"); return; } if (_asset.publisherKey.IsNullOrEmpty()) { - Debug.LogError("Publisher cannot be empty, object NimbusAdsManager not created"); + Debug.unityLogger.LogError("Nimbus", + "Publisher cannot be empty, object NimbusAdsManager not created"); return; } @@ -241,7 +243,7 @@ private bool ValidateApsData() { #endif if (appId.IsNullOrEmpty()) { - Debug.LogError( + Debug.unityLogger.LogError("Nimbus", "APS SDK has been included, the APS App ID cannot be empty, object NimbusAdsManager not created"); return false; } @@ -257,7 +259,7 @@ private bool ValidateApsData() { #endif if (slotData == null || slotData.Length == 0) { - Debug.LogError( + Debug.unityLogger.LogError("Nimbus", $"APS SDK has been included, APS placement slots for {platform} need to be entered, object NimbusAdsManager not created"); return false; } @@ -265,13 +267,13 @@ private bool ValidateApsData() { var seenAdTypes = new Dictionary(); foreach (var apsSlot in slotData) { if (apsSlot.SlotId.IsNullOrEmpty()) { - Debug.LogError( + Debug.unityLogger.LogError("Nimbus", $"APS SDK has been included, the APS slot id for {platform} cannot be empty, object NimbusAdsManager not created"); return false; } if (apsSlot.AdUnitType == AdUnitType.Undefined) { - Debug.LogError( + Debug.unityLogger.LogError("Nimbus", $"APS SDK has been included, Ad Unit type for {platform} cannot be Undefined, object NimbusAdsManager not created"); return false; } @@ -280,7 +282,7 @@ private bool ValidateApsData() { seenAdTypes.Add(apsSlot.AdUnitType, true); } else { - Debug.LogError( + Debug.unityLogger.LogError("Nimbus", $"APS SDK has been included, APS cannot contain duplicate ad type {apsSlot.AdUnitType} for {platform}, object NimbusAdsManager not created"); return false; } diff --git a/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Properties/AssemblyInfo.cs b/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Properties/AssemblyInfo.cs index e17c27a8..f6080307 100644 --- a/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Properties/AssemblyInfo.cs +++ b/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ -#if UNITY_EDITOR || UNITY_IOS || UNITY_ANDROID -#else +#if !UNITY_EDITOR && !UNITY_IOS && !UNITY_ANDROID using System.Reflection; using System.Runtime.InteropServices; diff --git a/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Tests.cs b/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Tests.cs index aead57c9..20241175 100644 --- a/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Tests.cs +++ b/com.adsbynimbus.nimbus/Runtime/Plugins/RTB.Tests/Tests.cs @@ -1,5 +1,4 @@ -#if UNITY_EDITOR || UNITY_IOS || UNITY_ANDROID -#else +#if !UNITY_EDITOR && !UNITY_IOS && !UNITY_ANDROID using System; using System.Diagnostics; using Newtonsoft.Json; diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Network/NimbusClient.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Network/NimbusClient.cs index b653cb07..3ffe7c23 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Network/NimbusClient.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/Network/NimbusClient.cs @@ -7,6 +7,7 @@ using Nimbus.ScriptableObjects; using OpenRTB.Request; using static System.String; +using UnityEngine; #if !UNITY_EDITOR using System.Text; @@ -53,6 +54,7 @@ public async Task MakeRequestAsync(BidRequest bidRequest) { #else // This will throw an exception if the bid request is missing required data from Nimbus var body = JsonConvert.SerializeObject(bidRequest); + Debug.unityLogger.Log("Nimbus", "BID REQUEST: " + body); HttpContent jsonBody = new StringContent(body, Encoding.UTF8, "application/json"); var serverResponse = await Client.PostAsync(_nimbusEndpoint, jsonBody, _ctx.Token); if (_ctx.Token.IsCancellationRequested) { diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnit.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnit.cs index 112a088e..ed945cfa 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnit.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/Nimbus.Internal/NimbusAdUnit.cs @@ -132,7 +132,7 @@ await Task.Run(async () => { _adEvents.FireOnAdErrorEvent(this); return; } - Debug.Log("BID RESPONSE: " + response); + Debug.unityLogger.Log("Nimbus","BID RESPONSE: " + response); _adWasReturned = true; RawBidResponse = response; BidResponse = JsonConvert.DeserializeObject(response); diff --git a/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs b/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs index 7e39d1cb..b0c773c1 100644 --- a/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs +++ b/com.adsbynimbus.nimbus/Runtime/Scripts/NimbusManager.cs @@ -278,7 +278,7 @@ public async void RequestRefreshingBannerAdAndLoad(CancellationTokenSource sourc /// public void ShowLoadedAd(NimbusAdUnit adUnit) { if (adUnit == null) { - Debug.unityLogger.LogError("", + Debug.unityLogger.LogError("Nimbus", "there was no ad to render, likely there was no fill meaning that demand did not want to spend"); return; } @@ -486,7 +486,6 @@ private async Task MakeRequestAsyncWithInterceptor(BidRequest bidRequest #endif private NimbusAdUnit RequestForNimbusAdUnit(BidRequest bidRequest, AdUnitType adUnitType) { - Debug.Log("BID REQUEST: " + JsonConvert.SerializeObject(bidRequest)); Task responseJson; try { responseJson = MakeRequestAsyncWithInterceptor(bidRequest, adUnitType, AdUnitHelper.IsAdTypeFullScreen(adUnitType));