wire-ios icon indicating copy to clipboard operation
wire-ios copied to clipboard

refactor: improve architecture - WPB-11396

Open johnxnguyen opened this issue 1 year ago • 1 comments

TaskWPB-11396 [iOS] improve analytics setup

Issue

This PR improves the architecture or our analytics setup so that we will be able to enable analytics during the login flow and track backup restore events. It also contains some various bug fixes and small refactoring.

Changes:

  • AnalyticsManager, AnalyticsSession are replaced with AnalyticsService.
  • AnalyticsService encapsulates the configuration, enabling, disabling, user management and tracking of events.
  • CountlyProtocol abstracts Countly.
  • Use cases for enabling and disabling tracking have been simplified.
  • AnalyticsEvent has become a struct, predefined events are now created by static helpers.
  • File organization
  • Bug fix: default segmentation (device type, os, etc) were not being tracked.

Testing

  • Updated unit tests for use cases
  • Unit tests for AnalyticsService

Checklist

  • [x] Title contains a reference JIRA issue number like [WPB-XXX].
  • [x] Description is filled and free of optional paragraphs.
  • [x] Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • [ ] Make sure you use the API for UI elements that support large fonts.
  • [ ] All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • [ ] New UI elements have Accessibility strings for VoiceOver.

johnxnguyen avatar Oct 02 '24 09:10 johnxnguyen