diff --git a/Runtime/Client/DotNetStandardClient.cs b/Runtime/Client/DotNetStandardClient.cs index 39282d6..6148a05 100644 --- a/Runtime/Client/DotNetStandardClient.cs +++ b/Runtime/Client/DotNetStandardClient.cs @@ -4,6 +4,10 @@ using System.Net.Http; using System.Threading.Tasks; +#if !UNITY_2022_1_OR_NEWER +using BugSplatUnity.Runtime.Util.Extensions; +#endif + namespace BugSplatUnity.Runtime.Client { internal interface IDotNetStandardExceptionClient diff --git a/Runtime/Plugins/BugSplatDotNetStandard.dll.meta b/Runtime/Plugins/BugSplatDotNetStandard.dll.meta index 76c390e..a001ffc 100644 --- a/Runtime/Plugins/BugSplatDotNetStandard.dll.meta +++ b/Runtime/Plugins/BugSplatDotNetStandard.dll.meta @@ -1,2 +1,33 @@ fileFormatVersion: 2 -guid: 51532154bbdb24d71babff241f230a10 \ No newline at end of file +guid: 51532154bbdb24d71babff241f230a10 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Reporter/WebGLReporter.cs b/Runtime/Reporter/WebGLReporter.cs index 5937e9f..331068f 100644 --- a/Runtime/Reporter/WebGLReporter.cs +++ b/Runtime/Reporter/WebGLReporter.cs @@ -3,8 +3,12 @@ using BugSplatUnity.Runtime.Util; using System; using System.Collections; -using UnityEngine; - +using UnityEngine; + +#if !UNITY_2022_1_OR_NEWER +using BugSplatUnity.Runtime.Util.Extensions; +#endif + namespace BugSplatUnity.Runtime.Reporter { internal class WebGLReporter : IExceptionReporter diff --git a/Runtime/Util/DictionaryExtensions.cs b/Runtime/Util/DictionaryExtensions.cs new file mode 100644 index 0000000..c46f460 --- /dev/null +++ b/Runtime/Util/DictionaryExtensions.cs @@ -0,0 +1,17 @@ +#if !UNITY_2022_1_OR_NEWER +using System.Collections.Generic; + +namespace BugSplatUnity.Runtime.Util.Extensions +{ + public static class DictionaryExtensions + { + public static bool TryAdd(this Dictionary dictionary, TKey key, TValue value) + { + if (dictionary == null) return false; + if (dictionary.ContainsKey(key)) return false; + dictionary.Add(key, value); + return true; + } + } +} +#endif \ No newline at end of file diff --git a/Runtime/Util/DictionaryExtensions.cs.meta b/Runtime/Util/DictionaryExtensions.cs.meta new file mode 100644 index 0000000..eed21f6 --- /dev/null +++ b/Runtime/Util/DictionaryExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ad6cf6bb0770004290306427cd3be9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Util/ReportPostOptionsExtensions.cs b/Runtime/Util/ReportPostOptionsExtensions.cs index caecbe1..e4a2810 100644 --- a/Runtime/Util/ReportPostOptionsExtensions.cs +++ b/Runtime/Util/ReportPostOptionsExtensions.cs @@ -1,6 +1,10 @@ using BugSplatUnity.Runtime.Settings; using System.Collections.Generic; +#if !UNITY_2022_1_OR_NEWER +using BugSplatUnity.Runtime.Util.Extensions; +#endif + namespace BugSplatUnity.Runtime.Util { internal static class ReportPostOptionsExtensions diff --git a/Tests/Runtime/Client/Fakes/FakeUnityWebClient.cs b/Tests/Runtime/Client/Fakes/FakeUnityWebClient.cs index 28af6d7..a98498a 100644 --- a/Tests/Runtime/Client/Fakes/FakeUnityWebClient.cs +++ b/Tests/Runtime/Client/Fakes/FakeUnityWebClient.cs @@ -64,6 +64,8 @@ class FakeExceptionPostOptions : IReportPostOptions public string Key { get; set; } public string Notes { get; set; } public string User { get; set; } - public int CrashTypeId { get; set; } + public int CrashTypeId { get; set; } + + public Dictionary AdditionalAttributes => new Dictionary(); } }