mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 00:29:20 +08:00
Don't even touch the firebase code if analytics are disabled
The anlaytics fuctions do not do anything when analytics collection is disabled, and I've verified that I do not get any events in the firebase dashboard. However, to be on the safer side lets not even touch the code. Related to #506
This commit is contained in:
@ -146,8 +146,10 @@ class Analytics {
|
||||
Map<String, String> parameters = const {},
|
||||
}) async {
|
||||
String name = _eventToString(e);
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
await firebase.logEvent(name: name, parameters: parameters);
|
||||
if (enabled) {
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
await firebase.logEvent(name: name, parameters: parameters);
|
||||
}
|
||||
}
|
||||
captureErrorBreadcrumb(name: name, parameters: parameters);
|
||||
}
|
||||
@ -160,13 +162,21 @@ class Analytics {
|
||||
}
|
||||
|
||||
Future<void> setCurrentScreen({required String screenName}) async {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
await firebase.setCurrentScreen(screenName: screenName);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> setUserProperty(
|
||||
{required String name, required String value}) async {
|
||||
Future<void> setUserProperty({
|
||||
required String name,
|
||||
required String value,
|
||||
}) async {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
await firebase.setUserProperty(name: name, value: value);
|
||||
}
|
||||
|
@ -125,6 +125,10 @@ void captureErrorBreadcrumb({
|
||||
required String name,
|
||||
required Map<String, String> parameters,
|
||||
}) {
|
||||
if (!reportCrashes) {
|
||||
return;
|
||||
}
|
||||
|
||||
var b = Breadcrumb(
|
||||
message: name,
|
||||
timestamp: DateTime.now(),
|
||||
|
Reference in New Issue
Block a user