Skip to content

Releases: snowplow/snowplow-ios-tracker

Version 5.2.0

02 Jun 14:41
Compare
Choose a tag to compare

Tracker plugins provide a new filter callback that enables you to add custom logic that decides whether a given event should be tracked or not. This can for example enable you to intercept events automatically tracked by the tracker and skip some of them. For instance, the following code will apply to all screen view events and only accept ones with the name "Home Screen", other screen view events will be discarded:

plugin.filter(schemas: [
    "iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0", // screen view events
]) { event in
    return event.payload["name"] as? String == "Home Screen"
}

Finally, you can now provide a configuration version for default configuration used in the remote configuration setup. This makes sure that the tracker is only reloaded when a newer configuration is available on the remote endpoint than the default one.

Enhancements

  • Add a filter API to plugins to decide whether to track an event or not (#783)
  • Add version to default remote configuration and don't update unless remote configuration is newer (#779)

Under the hood

  • Handle unprotected access to sending state in Emitter from concurrent threads (#774)

Version 5.1.0

11 May 16:23
Compare
Choose a tag to compare

This minor release extends the platform context entity tracked in events with new information:

  • isPortrait – whether the device orientation is portrait (either upright or upside down).
  • resolution – Screen resolution in pixels.
  • scale – Scale factor used to convert logical coordinates to device coordinates of the screen.
  • language – System language currently used on the device (ISO 639)

It also makes it configurable which properties should be tracked in the platform context entity using the TrackerConfiguration.platformContextEntities configuration.

Enhancements

  • Track new properties in platform context version 1-0-3 and make it configurable which properties to track (#771)

Bug fixes

  • Fix remote config negative hash bug (#775)
  • Fix memory leak when tracker is fetched in remote configuration (#776)

Version 5.0.1

02 May 12:31
Compare
Choose a tag to compare

This patch release fixes a bug introduced in the 5.0 release of the tracker that resulted in validation errors of tracked events when user anonymisation was enabled. This was caused by a missing property in the client session context entity.

Bug fixes

  • Fix validation errors due to session schema tracked without required previousSessionId property when anonymous tracking (#767)

Version 5.1.0-beta.1

05 Apr 17:49
Compare
Choose a tag to compare
Version 5.1.0-beta.1 Pre-release
Pre-release

This pre-release ads an integration with the FocalMeter system by Kantar that measures audience of content through a router meter.

Enhancements

  • Add configuration to send requests with user ID to a Focal Meter endpoint (#745)

Version 5.0.0

04 Apr 15:11
Compare
Choose a tag to compare

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.

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)

Version 5.0.0-beta.1

03 Feb 11:58
Compare
Choose a tag to compare
Version 5.0.0-beta.1 Pre-release
Pre-release

This is the third pre-release of the upcoming version 5 of the iOS tracker, written in Swift. This beta release brings new features as well as refactoring the tracker internals.

The headline feature is the ability to provide custom tracker plugins to intercept tracked events. Plugins provide callbacks that can enrich events with additional entities and inspect tracked events. See this snippet for a glimpse of a tracker plugin:

// identifier needs to uniquely identify the plugin
let plugin = PluginConfiguration(identifier: "myPlugin")

// entities closure can return context entities to enrich events
// the list of schemas to call the closure for is optional (it will be called for all events if null)
plugin.entities(schemas: ["iglu:..."]) { event in
    return [
        SelfDescribingJson(schema: "iglu:xx", andData: ["yy": true])
    ]
}

// after track callback called on a background thread to inspect final tracked events
// one can also supply a list of schemas to call the closure only for specific events
plugin.afterTrack { event in
    print("Tracked event with \(event.entities.count) entities")
}

// the plugin is supplied to the tracker as a configuration
let tracker = Snowplow.createTracker(namespace: "ns",
                                     network: networkConfig,
                                     configurations: [plugin])

There is also an option to use Swift DSL to configure a tracker instance making the configuration code easier to read:

Snowplow.createTracker(namespace: "appTracker", endpoint: COLLECTOR_URL) {
  TrackerConfiguration()
      .base64Encoding(false)
      .sessionContext(true)

  SessionConfiguration(
      foregroundTimeout: Measurement(value: 30, unit: .minutes),
      backgroundTimeout: Measurement(value: 30, unit: .minutes)
  )
}

Finally, we have refactored the tracker internals to simplify the code and improve it's maintainability. Apart from improvements under the hood, the tracker is now easier to use in Swift as the API doesn't enforce numbers and dictionaries to be passed as NSObject.

Enhancements

  • Add ability to provide custom tracker plugins to inspect and enrich tracked events (#750)
  • Use Swift DSL for building configurations and add builder functions for configurations and events (#755)

Under the hood

  • Remove requirement for all configurations to be serializable (#753)
  • Refactor event interface and rename contexts to entities (#757)
  • Refactor APIs to replace usage of NSObject in dictionaries with the Any type (#748)
  • Update year in copyright headers and remove authors from headers in source files (#759)

Version 5.0.0-alpha.2

21 Dec 10:34
Compare
Choose a tag to compare
Version 5.0.0-alpha.2 Pre-release
Pre-release

This is the second pre-release of the upcoming version 5 of the iOS tracker written in Swift. This pre-release brings several significant features and changes to the tracker: (1) screen view tracking in SwiftUI, (2) move to Swift Package Manager as the build system and removal of Carthage, and (3) a new way to track the IDFA identifier for advertisers.

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.

Support for Carthage has been removed from the project. Fully adopting the Swift Package Manager enables us to simplify the build system and avoid workarounds that were previously needed to support Carthage. We believe this will make it easier to maintain the tracker while covering all use cases with Swift Package Manager and CocoaPods. If you have feedback about this change, we'd be happy to hear from you on Discourse!

Finally, the release fixes a problem that the IDFA identifier could not be tracked on apps installing the library through Swift Package Manager. It introduces a new API to set a closure in TrackerConfiguration.advertisingIdentifierRetriever that retrieves and returns the identifier.

Enhancements

  • Add screen view tracking for SwiftUI (#705)
  • Drop Carthage and build using Swift Package Manager (#735)
  • Add a closure to tracker configuration that enables retrieving IDFA value and replaces the use of SNOWPLOW_IDFA_ENABLED macro (#678)
  • Add API docs using Swift-DocC (#739)

Under the hood

  • Add tests using Micro for payload validation (#736)
  • Update API comments for Swift-DocC and add missing comments (#740)

Version 5.0.0-alpha.1

30 Nov 15:54
Compare
Choose a tag to compare
Version 5.0.0-alpha.1 Pre-release
Pre-release

We are excited to announce our plans for the version 5 of our iOS Tracker. In addition, we are releasing the first alpha pre-release of the v5 tracker.

The major enhancement is the modernization of the trackers – we will migrate the iOS tracker from Objective-C to Swift. This opens up a range of exciting new possibilities for the tracker. It will provide APIs that work better with modern Swift and Kotlin apps. We will also be able to bring new features to the trackers such as autotracking for SwiftUI. The modern programming language will enable a safer implementation of core features of the tracker. Finally, it will enable us to simplify the tracker code and build system, making it easier to contribute to and maintain the trackers moving forward.

Version 5 will also bring other new features to the trackers that we are already excited about. We will announce these as we progress on them and publish next pre-releases. Stay tuned!

If you are interested in testing the experimental alpha 1 release, we would appreciate your feedback!

CHANGELOG

  • Migrate to Swift (#732)

Version 4.1.0

30 Nov 06:39
Compare
Choose a tag to compare

This release improves the anonymous tracking functionality by anonymising additional properties in Subject and Session. In Subject, the manually set userId, domainUserId, networkUserId, and ipAddress are now anonymised. In Session, previousSessionId is anonymised to prevent stitching independent anonymous sessions.

Now the tracker also sets the page_referrer and page_url atomic event properties for Screen View events. This improves compatibility with the Referer parser enrichment.

Enhancements

  • Anonymise previous session ID and user identifiers in subject when user anonymisation is enabled (#720)
  • Add DeepLink entity referrer and url to atomic properties in ScreenView events (#718)
  • Fix compiler warning in SPEmitterControllerImpl to synthesize customRetryForStatusCodes (#722)
  • Log an error when recreating tracker after being removed (#716)

Under the hood

  • Fix links in README (#724)

Version 4.0.1

18 Oct 19:41
36b53bb
Compare
Choose a tag to compare

This patch release fixes a bug raised and solved by Wipoo Shinsirikul (@mylifeasdog). When tracker is paused from tracking events the track method doesn't track events, hence it returns nil rather than the event ID of the tracked events. Unfortunately, on Swift the track method doesn't return an optional and that was a cause of crashes.
This patch release fixes the track method for Swift avoiding the crashes.

CHANGELOG

Bug fixes:

  • Add nullable modifier to prevent crashes in track function (#713)