Snowplow Android and iOS trackers v5.0.0 released

We’re very excited to announce the version 5 of our mobile trackers.

The major enhancement is the modernization of the trackers – we migrated the iOS tracker code base from Objective-C to Swift and Android from Java to Kotlin. This enables the tracker to provide APIs that work better with modern Swift and Kotlin apps. The modern programming languages also enable a safer implementation of core features of the tracker. Finally, we could simplify the tracker code and build system, making it easier to contribute to and maintain the trackers moving forward.

Version 5 also brings the ability to implement custom tracker plugins to intercept tracked events. Plugins provide callbacks that can enrich events with additional entities and inspect tracked events. You can read more about mobile tracker plugins in the documentation.

We also improved support for tracking screen views in modern UI frameworks – SwiftUI and JetPack Compose. Screen views in SwiftUI apps can now be tracked using the .snowplowScreen(name: "ScreenName") modifier on the View component. For views annotated with the modifier, screen view events will be tracked as the views appear in the SwiftUI lifecycle. For JetPack Compose, we prepared a demo app that showcases best practices for tracking screen views in Compose apps. Read more about the support in the documentation.

The tracker is now easier to use in Swift as the API doesn’t enforce numbers and dictionaries to be passed as NSObject. The release also fixes a problem that the IDFA identifier could not be tracked on apps installing the library through Swift Package Manager. Support for Carthage has been removed from the iOS tracker and the project now fully adopts Swift Package Manager as the build system. On the Android tracker, Gradle has been upgraded to 7.6.

Please refer to the migration guide to learn about the breaking changes and how to resolve them.

CHANGELOG - Android

Enhancements

  • Add Jetpack Compose demo app (#586)
  • Add ability to provide custom tracker plugins to inspect and enrich tracked events (#574)

Under the hood

  • Add default POST argument to basic createTracker method (#592)
  • Reintroduce customContexts as a Java field and return a mutable list from entities in events (#590)
  • Add plugin example to Kotlin demo (#593)
  • Use Dokka for API docs (#591)
  • Upgrade Gradle to 7.6 and lower minSdkVersion requirement to 21 (#587 and #585)
  • Update copyrights to 2023 (#579)
  • Refactor event interface and rename contexts to entities (#573)
  • Migrate internal classes to Kotlin (#564)
  • Migrate published API to Kotlin (#561)

CHANGELOG - iOS

Enhancements

  • Migrate to Swift (#732)
  • Add ability to provide custom tracker plugins to inspect and enrich tracked events (#750)
  • Add screen view tracking for SwiftUI (#705)
  • Use Swift DSL for building configurations and add builder functions for configurations and events (#755)
  • Refactor event interface and rename contexts to entities (#757)
  • Refactor APIs to replace usage of NSObject in dictionaries with the Any type (#748)
  • Add a closure to tracker configuration that enables retrieving IDFA value and replaces the use of SNOWPLOW_IDFA_ENABLED macro (#678)

Under the hood

  • Drop Carthage and build using Swift Package Manager (#735)
  • Remove requirement for all configurations to be serializable (#753)
  • Rename the repository from snowplow-objc-tracker to snowplow-ios-tracker
  • Update year in copyright headers and remove authors from headers in source files (#759)
  • Add tests using Micro for payload validation (#736)
  • Add redirect from root documentation page
  • Update API comments for Swift-DocC and add missing comments (#740)
  • Add API docs using Swift-DocC (#739)

Snowplow Android Tracker version 5.0.0 is available on Maven Central .
The project’s source code can be found here .

Snowplow iOS Tracker version 5.0.0 is available on Cocoapods .
The project’s source code can be found here .

2 Likes