mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-25 08:12:19 +08:00
Analytics: Fix session ID
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:fixnum/fixnum.dart';
|
import 'package:fixnum/fixnum.dart';
|
||||||
import 'package:recase/recase.dart';
|
import 'package:recase/recase.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
@ -61,7 +59,6 @@ enum Event {
|
|||||||
*/
|
*/
|
||||||
ScreenView,
|
ScreenView,
|
||||||
}
|
}
|
||||||
const int _intMaxValue = 9007199254740991;
|
|
||||||
|
|
||||||
class Analytics {
|
class Analytics {
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
@ -73,7 +70,8 @@ class Analytics {
|
|||||||
}) {
|
}) {
|
||||||
_global = Analytics();
|
_global = Analytics();
|
||||||
_global!.enabled = enable;
|
_global!.enabled = enable;
|
||||||
_global!.sessionId = Random().nextInt(_intMaxValue).toRadixString(16);
|
_global!.sessionId =
|
||||||
|
DateTime.now().millisecondsSinceEpoch.toRadixString(16);
|
||||||
|
|
||||||
var p = pref.getString("pseudoId");
|
var p = pref.getString("pseudoId");
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
|
Reference in New Issue
Block a user