amplify-swift
amplify-swift copied to clipboard
feat(Analytics): Adding cross-platform support
Description of changes:
Adding support for cross-platform builds to Analytics:
- Implementing a
Combine-free alternative to the State Machine implementation that is used for Session Tracking. - Renaming
UIActivityTrackerto justActivityTracker, supporting tracking for both mobile and desktop apps- Defaulting the background tracking timeout on macOS to
.infinite, i.e. no timeout at all.
- Defaulting the background tracking timeout on macOS to
- Following what JS does and after agreeing with Flutter, we will only be recording session start and stop events for desktop apps. This change is done in
SessionClient, so thatActivityTrackerdoes not have this business logic. - Using the new
DeviceInfostruct to retrieve information about the device. Renamed the oldDeviceprotocol to a more fittingEndpointInformationand kept it around for testing purposes.
Check points: (check or cross out if not relevant)
- [ ] ~Added new tests to cover change, if needed~
- [X] Build succeeds with all target using Swift Package Manager
- [X] All unit tests pass
- [ ] ~All integration tests pass~
- [X] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
- [ ] ~Documentation update for the change if required~
- [X] PR title conforms to conventional commit style
- [X] ~If breaking change, documentation/changelog update with migration instructions~
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.