mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 00:29:20 +08:00
IAP: Do not send the psuedoId
Lets keep the analytics completely separate from everything else. I don't want to have the ability to map analytics with IAP. The latter can have personally identifiable information.
This commit is contained in:
@ -70,15 +70,15 @@ class Analytics {
|
|||||||
}) {
|
}) {
|
||||||
_global = Analytics();
|
_global = Analytics();
|
||||||
_global!.enabled = enable;
|
_global!.enabled = enable;
|
||||||
_global!.sessionId =
|
_global!._sessionId =
|
||||||
DateTime.now().millisecondsSinceEpoch.toRadixString(16);
|
DateTime.now().millisecondsSinceEpoch.toRadixString(16);
|
||||||
|
|
||||||
var p = pref.getString("pseudoId");
|
var p = pref.getString("pseudoId");
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
_global!.pseudoId = const Uuid().v4();
|
_global!._pseudoId = const Uuid().v4();
|
||||||
pref.setString("pseudoId", _global!.pseudoId);
|
pref.setString("pseudoId", _global!._pseudoId);
|
||||||
} else {
|
} else {
|
||||||
_global!.pseudoId = p;
|
_global!._pseudoId = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _global!;
|
return _global!;
|
||||||
@ -86,8 +86,8 @@ class Analytics {
|
|||||||
|
|
||||||
static Analytics? get instance => _global!;
|
static Analytics? get instance => _global!;
|
||||||
|
|
||||||
late String sessionId;
|
late String _sessionId;
|
||||||
late String pseudoId;
|
late String _pseudoId;
|
||||||
var userProps = <String, String>{};
|
var userProps = <String, String>{};
|
||||||
|
|
||||||
Future<void> log(
|
Future<void> log(
|
||||||
@ -125,9 +125,9 @@ class Analytics {
|
|||||||
name: name,
|
name: name,
|
||||||
date: Int64(DateTime.now().millisecondsSinceEpoch ~/ 1000),
|
date: Int64(DateTime.now().millisecondsSinceEpoch ~/ 1000),
|
||||||
params: params,
|
params: params,
|
||||||
pseudoId: pseudoId,
|
pseudoId: _pseudoId,
|
||||||
userProperties: userProps,
|
userProperties: userProps,
|
||||||
sessionID: sessionId,
|
sessionID: _sessionId,
|
||||||
userFirstTouchTimestamp: null,
|
userFirstTouchTimestamp: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import 'package:in_app_purchase/in_app_purchase.dart';
|
|||||||
import 'package:in_app_purchase/store_kit_wrappers.dart';
|
import 'package:in_app_purchase/store_kit_wrappers.dart';
|
||||||
import 'package:universal_io/io.dart' show Platform;
|
import 'package:universal_io/io.dart' show Platform;
|
||||||
|
|
||||||
import 'package:gitjournal/analytics/analytics.dart';
|
|
||||||
import 'package:gitjournal/app.dart';
|
import 'package:gitjournal/app.dart';
|
||||||
import 'package:gitjournal/error_reporting.dart';
|
import 'package:gitjournal/error_reporting.dart';
|
||||||
import 'package:gitjournal/features.dart';
|
import 'package:gitjournal/features.dart';
|
||||||
@ -185,7 +184,7 @@ Future<DateTime?> getExpiryDate(
|
|||||||
var body = {
|
var body = {
|
||||||
'receipt': receipt,
|
'receipt': receipt,
|
||||||
"sku": sku,
|
"sku": sku,
|
||||||
'pseudoId': Analytics.instance?.pseudoId,
|
'pseudoId': '',
|
||||||
'is_purchase': isPurchase,
|
'is_purchase': isPurchase,
|
||||||
};
|
};
|
||||||
Log.i("getExpiryDate ${json.encode(body)}");
|
Log.i("getExpiryDate ${json.encode(body)}");
|
||||||
|
Reference in New Issue
Block a user