mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +08:00
Collect proMode and proExpirationDate as user properties
It'll make it easier to know how many % of the users are on pro.
This commit is contained in:
15
lib/app.dart
15
lib/app.dart
@ -55,7 +55,7 @@ class JournalApp extends StatefulWidget {
|
||||
Log.i("Setting ${settings.toLoggableMap()}");
|
||||
|
||||
if (appSettings.collectUsageStatistics) {
|
||||
_enableAnalyticsIfPossible(settings);
|
||||
_enableAnalyticsIfPossible(appSettings, settings);
|
||||
}
|
||||
_sendAppUpdateEvent(appSettings);
|
||||
|
||||
@ -126,7 +126,8 @@ class JournalApp extends StatefulWidget {
|
||||
));
|
||||
}
|
||||
|
||||
static void _enableAnalyticsIfPossible(Settings settings) async {
|
||||
static void _enableAnalyticsIfPossible(
|
||||
AppSettings appSettings, Settings settings) async {
|
||||
JournalApp.isInDebugMode = foundation.kDebugMode;
|
||||
|
||||
var isPhysicalDevice = true;
|
||||
@ -155,6 +156,16 @@ class JournalApp extends StatefulWidget {
|
||||
JournalApp.analytics.setAnalyticsCollectionEnabled(enabled);
|
||||
|
||||
if (enabled) {
|
||||
getAnalytics().firebase.setUserProperty(
|
||||
name: 'proMode',
|
||||
value: appSettings.proMode.toString(),
|
||||
);
|
||||
|
||||
getAnalytics().firebase.setUserProperty(
|
||||
name: 'proExpirationDate',
|
||||
value: appSettings.proExpirationDate.toString(),
|
||||
);
|
||||
|
||||
logEvent(Event.Settings, parameters: settings.toLoggableMap());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user