-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sentry integration * Force crash button fix * Unit tests fixes
- Loading branch information
Showing
14 changed files
with
101 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace BMM.Core.Exceptions | ||
{ | ||
public class ForcedException : Exception | ||
{ | ||
public ForcedException(object sender) : base(sender.ToString()) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Microsoft.AppCenter; | ||
using Microsoft.AppCenter.Analytics; | ||
using Microsoft.Maui.Devices; | ||
|
||
namespace BMM.Core.Helpers | ||
{ | ||
public abstract class AnalyticsInitializer | ||
{ | ||
private static string iOSPrefix = "ios_"; | ||
private static string AndroidPrefix = "android_"; | ||
private static string Dev = "dev"; | ||
private static string Prod = "prod"; | ||
|
||
public static void DroidRegister() | ||
{ | ||
if (!AppCenter.Configured) | ||
AppCenter.Start(GlobalConstants.DroidAppSecret, typeof(Analytics)); | ||
|
||
InitSentry(); | ||
} | ||
|
||
public static void IOSRegister() | ||
{ | ||
if (!AppCenter.Configured) | ||
AppCenter.Start(GlobalConstants.iOSAppSecret, typeof(Analytics)); | ||
|
||
InitSentry(); | ||
} | ||
|
||
private static void InitSentry() | ||
{ | ||
SentrySdk.Init(options => | ||
{ | ||
options.Dsn = GlobalConstants.SentryDsn; | ||
options.Environment = GetSentryEnvironment(); | ||
options.Debug = false; | ||
options.TracesSampleRate = 1.0; | ||
options.ProfilesSampleRate = 1.0; | ||
}); | ||
} | ||
|
||
private static string GetSentryEnvironment() | ||
{ | ||
string env; | ||
|
||
#if ENV_INT | ||
env = Dev; | ||
#else | ||
env = Prod; | ||
#endif | ||
|
||
return DeviceInfo.Current.Platform == DevicePlatform.Android | ||
? $"{AndroidPrefix}{env}" | ||
: $"{iOSPrefix}{env}"; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters