📈 Tracking data's analytics service
This commit is contained in:
@@ -27,6 +27,7 @@ import 'package:island/widgets/post/compose_recorder.dart';
|
||||
import 'package:island/pods/drive/file_pool.dart';
|
||||
import 'package:pasteboard/pasteboard.dart';
|
||||
import 'package:island/talker.dart';
|
||||
import 'package:island/services/analytics_service.dart';
|
||||
|
||||
class ComposeState {
|
||||
final TextEditingController titleController;
|
||||
@@ -738,6 +739,17 @@ class ComposeLogic {
|
||||
onSuccess();
|
||||
eventBus.fire(PostCreatedEvent());
|
||||
|
||||
final postTypeStr = state.postType == 0 ? 'regular' : 'article';
|
||||
final visibilityStr = state.visibility.value.toString();
|
||||
final publisherId = state.currentPublisher.value?.id ?? 'unknown';
|
||||
|
||||
AnalyticsService().logPostCreated(
|
||||
postTypeStr,
|
||||
visibilityStr,
|
||||
state.attachments.value.isNotEmpty,
|
||||
publisherId,
|
||||
);
|
||||
|
||||
return post;
|
||||
} catch (err) {
|
||||
showErrorAlert(err);
|
||||
|
||||
@@ -28,6 +28,7 @@ import 'package:island/widgets/post/compose_sheet.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:super_context_menu/super_context_menu.dart';
|
||||
import 'package:island/services/analytics_service.dart';
|
||||
|
||||
const kAvailableStickers = {
|
||||
'angry',
|
||||
@@ -367,7 +368,15 @@ class PostItem extends HookConsumerWidget {
|
||||
),
|
||||
);
|
||||
HapticFeedback.heavyImpact();
|
||||
|
||||
AnalyticsService().logPostReacted(
|
||||
item.id,
|
||||
symbol,
|
||||
attitude,
|
||||
isRemoving,
|
||||
);
|
||||
});
|
||||
|
||||
reacting.value = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user