mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 13:53:41 +00:00
feat: add anonymous analytics (#1254)
This commit is contained in:
7 files changed
+204
-10
No files matched your search
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gopeed/util/analytics.dart';
|
||||
import 'package:hotkey_manager/hotkey_manager.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
@@ -195,4 +196,13 @@ Future<void> onStart() async {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (Config.isConfigured && Database.instance.getAnalyticsEnabled()) {
|
||||
try {
|
||||
await Analytics.instance.init();
|
||||
await Analytics.instance.logAppOpen();
|
||||
} catch (e) {
|
||||
logger.w("GA4 init failed: $e");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user