diff --git a/CHANGELOG.md b/CHANGELOG.md index 0156e4e4..c9dc8efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ -## 24.1.0 +## XX.XX.XX +* Fixed an issue where some requests are not url encoded. +## 24.1.0 * New BackendMode features added and accesible through "Countly.Instance.BackendMode()" interface: * "ChangeDeviceIdWithMerge" * "RecordUserProperties" diff --git a/countlyCommon/countlyCommon/Server/ApiBase.cs b/countlyCommon/countlyCommon/Server/ApiBase.cs index a066dac1..14aad5d4 100644 --- a/countlyCommon/countlyCommon/Server/ApiBase.cs +++ b/countlyCommon/countlyCommon/Server/ApiBase.cs @@ -43,7 +43,7 @@ public async Task SendEvents(string serverUrl, RequestHelper requ public async Task SendException(string serverUrl, RequestHelper requestHelper, int rr, ExceptionEvent exception) { - string exceptionJson = RequestHelper.Json(exception); + string exceptionJson = UtilityHelper.EncodeDataForURL(RequestHelper.Json(exception)); return await Call(string.Format("{0}{1}&crash={2}&rr={3}", serverUrl, await requestHelper.BuildRequest(), exceptionJson, rr)); } @@ -52,7 +52,7 @@ public async Task UploadUserDetails(string serverUrl, RequestHelp string userDetailsJson = string.Empty; if (userDetails != null) { - userDetailsJson = RequestHelper.Json(userDetails); + userDetailsJson = UtilityHelper.EncodeDataForURL(RequestHelper.Json(userDetails)); } return await Call(string.Format("{0}{1}&user_details={2}&rr={3}", serverUrl, await requestHelper.BuildRequest(), userDetailsJson, rr)); @@ -63,7 +63,7 @@ public async Task UploadUserPicture(string serverUrl, RequestHelp string userDetailsJson = string.Empty; if (userDetails != null) { - userDetailsJson = "=" + RequestHelper.Json(userDetails); + userDetailsJson = "=" + UtilityHelper.EncodeDataForURL(RequestHelper.Json(userDetails)); } return await Call(string.Format("{0}{1}&user_details{2}&rr={3}", serverUrl, await requestHelper.BuildRequest(), userDetailsJson, rr), imageStream); diff --git a/netstd/Countly/Countly.csproj b/netstd/Countly/Countly.csproj index 145d51f3..2a137ef3 100644 --- a/netstd/Countly/Countly.csproj +++ b/netstd/Countly/Countly.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 diff --git a/netstd/MauiSampleApp/MauiExceptions.cs b/netstd/MauiSampleApp/MauiExceptions.cs index c1c57180..b0ac4e7d 100644 --- a/netstd/MauiSampleApp/MauiExceptions.cs +++ b/netstd/MauiSampleApp/MauiExceptions.cs @@ -13,10 +13,17 @@ static MauiExceptions() // It will fire for exceptions from iOS and Mac Catalyst, // and for exceptions on background threads from WinUI 3. - AppDomain.CurrentDomain.UnhandledException += (sender, args) => { + AppDomain.CurrentDomain.UnhandledException += (sender, args) => + { UnhandledException?.Invoke(sender, args); }; + // Events fired by the TaskScheduler. That is calls like Task.Run(...) + TaskScheduler.UnobservedTaskException += (sender, args) => + { + UnhandledException?.Invoke(sender, new UnhandledExceptionEventArgs(args.Exception, false)); + }; + #if IOS || MACCATALYST // For iOS and Mac Catalyst @@ -35,10 +42,11 @@ static MauiExceptions() // All exceptions will flow through Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser, // and NOT through AppDomain.CurrentDomain.UnhandledException - //Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) => - //{ - // UnhandledException?.Invoke(sender, new UnhandledExceptionEventArgs(args.Exception, true)); - //}; + Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) => + { + args.Handled = true; + UnhandledException?.Invoke(sender, new UnhandledExceptionEventArgs(args.Exception, true)); + }; #elif WINDOWS diff --git a/netstd/MauiSampleApp/Platforms/iOS/CrashTester.cs b/netstd/MauiSampleApp/Platforms/iOS/CrashTester.cs index 23c0481d..6c10a1fc 100644 --- a/netstd/MauiSampleApp/Platforms/iOS/CrashTester.cs +++ b/netstd/MauiSampleApp/Platforms/iOS/CrashTester.cs @@ -4,6 +4,6 @@ public class CrashTester : ICrashTester { public void Test() { - + throw new InvalidOperationException("This is a test unhandled exception."); } }