Skip to content

Commit c8d0bab

Browse files
committed
Fix automatic Debug/Release mode detection
1 parent 56bd86c commit c8d0bab

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.6
2+
3+
* Fix automatic Debug/Release mode detection
4+
15
## 0.0.5
26

37
* Added support for automatic segregation of Debug/Release events

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Instrument your apps with Aptabase, an Open Source, Privacy-First and, Simple An
99
Start by adding the Aptabase NuGet package to your .csproj:
1010

1111
```xml
12-
<PackageReference Include="Aptabase.Maui" Version="0.0.5" />
12+
<PackageReference Include="Aptabase.Maui" Version="0.0.6" />
1313
```
1414

1515
## Usage

package/Aptabase.Maui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>Aptabase.Maui</PackageId>
5-
<Version>0.0.5</Version>
5+
<Version>0.0.6</Version>
66
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
77
<Description>Maui SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps</Description>
88
<Authors>Aptabase Team</Authors>

package/SystemInfo.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal class SystemInfo
77
private static string _pkgVersion = typeof(AptabaseClient).Assembly
88
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;
99

10-
public bool IsDebug { get; }
10+
public bool IsDebug { get; private set; }
1111
public string OsName { get; }
1212
public string OsVersion { get; }
1313
public string SdkVersion { get; }
@@ -17,7 +17,8 @@ internal class SystemInfo
1717

1818
public SystemInfo()
1919
{
20-
this.IsDebug = GetIsDebug();
20+
this.MaybeSetDebugMode();
21+
2122
this.OsName = GetOsName();
2223
this.OsVersion = GetOsVersion();
2324
this.SdkVersion = $"Aptabase.Maui@{_pkgVersion}";
@@ -26,13 +27,10 @@ public SystemInfo()
2627
this.AppBuildNumber = AppInfo.Current.BuildString;
2728
}
2829

29-
private bool GetIsDebug()
30+
[Conditional("DEBUG")]
31+
public void MaybeSetDebugMode()
3032
{
31-
#if DEBUG
32-
return true;
33-
#else
34-
return false;
35-
#endif
33+
this.IsDebug = true;
3634
}
3735

3836
private string GetOsName()

0 commit comments

Comments
 (0)