Anura Core SDK iOS 1.9.0 Migration Guide

Anura Core SDK iOS 1.9.0 is a major update that includes the following improvements and features:

  • New measurement UI that utilizes the device's screen as a light source for more accurate and reliable measurements
  • Replaced the existing visage|SDK FaceTrack with MediaPipe FaceMesh for improved performance and simplified integration
  • Improved WebSocket handling in poor network conditions
  • DeepAffex token security enhancements

Upgrading to Anura Core iOS 1.9.0

A few steps are required to upgrade your existing app from Anura Core 1.8.x to 1.9.0.

Updating SDK Binaries

Replace the existing AnuraCore.xcframework and libdfx.xcframework frameworks in your application with the latest versions.

Adopting the new UI

Anura Core SDK 1.9.0 features a new measurement UI that utilizes the device's screen as a light source for more accurate and reliable measurements.

Existing applications will adopt the new measurement UI and behaviour automatically through the defaultConfiguration property of MeasurementConfiguration and MeasurementUIConfiguration. If your application needs to maintain the UI and behaviour of previous versions of Anura Core SDK, you may use the corresponding defaultLegacyConfiguration

MediaPipe FaceMesh

Anura Core SDK 1.9.0 includes support for MediaPipe FaceMesh which provides improved performance, a smaller binary size, and simplifies integration with your application.

To start using MediaPipe, you will need to add FaceMesh.xcframework to your application's embedded frameworks. You can simply initialize an instance of MediaPipeFaceTracker and pass it to AnuraMeasurementViewController during initialization. Be sure to add <AnuraCore/MediaPipeFaceTracker.h> to your application's bridging header.

You may also remove visage|SDK FaceTrack and its dependencies and assets:

  • visageSDK-iOS folder
  • bdtsdata assets folder
  • libVisageVision.a static library
  • TFPlugin.xcframework dynamic library
  • Any .vlc license files

You may also update your Xcode build target's settings to remove any settings related to visage|SDK FaceTrack:

  • Remove "$(SRCROOT)/Frameworks/visageSDK-iOS/include" from Header Search Paths
  • Remove VISAGE_STATIC and IOS from Preprocessor Macros

Note: MediaPipe is not tied to your application ID, and does not require a separate license file for each variant of your application.

visage|SDK FaceTrack support

If you would like to continue using visage|SDK FaceTrack, you may use the Visage classes and binaries provided in previous versions of Anura Core SDK.

MeasurementResults Changes

MeasurementResults class has been updated to parse the Notes field from DeepAffex Cloud that provide additional information about the computation of the results. The allResults property has been changed to return [String: SignalResult] instead of [String: Double], with SignalResult having 2 properties: value: Double and notes: [String].

Your application should be updated to read the value property for each SignalResult, and the notes property will contain additional information about the computation of the that result. For more information on notes, please refer to DeepAffex Cloud API - Subscribe to Results endpoint documentation.

Early Measurement Cancellation Logic

AnuraMeasurementViewController includes a new shouldCancelMeasurement(snr: Double, chunkOrder: Int) -> Bool method in AnuraMeasurementViewController to determine if a measurement should be cancelled early.

In previous versions of the Sample App, the measurement early cancellation logic was in the example code. If your application was using that code, you should replace that code with calling this new method.

Improved DeepAffex Cloud API Client

Anura Core SDK iOS 1.9.0 includes an improved DeepAffex Cloud API client that can better handle WebSocket connections in poor network conditions.

Your application will these improvements by using the updated DeepAffexMiniAPIClient and MeasurementResultsSubscriber classes included in the Sample App.

An important security update to the DeepAffex™ Cloud API was released on November 28, 2023, which expires tokens after a fixed duration. This will impact your user's experience if you choose to keep using the older Anura™ Core SDKs. Upgrading to the latest Anura™ Core SDKs ensures seamless adaptation to these API changes.

Your application must use the new beginStartupFlow(_:) method of DeepAffexMiniAPIClient to ensure that it has a valid token prior to taking a measurement. This method encapsulates the code that was in previous versions of StartViewController, and your application should replace that code with calling the new beginStartupFlow(_:) method.

Notes

  • The new FaceMesh.xcframework currently does not support iOS Simulator on Intel-based Macs