Sternum iOS SDK
Sternum iOS SDK

This repository contains the files of the Sternum iOS SDK, a versatile and flexible tool for implementing Relay applications and adding observability and traceability into iOS devices using C, C++ or Objective-C.

For introduction and integration information, refer to the Online documentation.

How to import the SDK

  1. Create a directory called libs in your component root directory.
  2. Take the provided libSternumSDK.a and include/ and place it in the libs directory.
  3. Open your component in Xcode ([component].xcodeproj) in the Xcode IDE. Use a right click to add existing files to the project and select the libs/ directory. When adding the libs/ directory to the project, make sure to select all of the relevant targets to avoid compilation errors.

Using the API

  1. Add the following import to use the component within your code:
    • Objective-C:
      #import "sternum_sdk.h"
    • C/C++:
      #include "sternum_sdk.h"
  2. Initialize the SDK
    sternum_sdk_initialize("gateway.sternum.cloud", false, 1234123412341234, true, 0x2000);
  3. Send traces
    STERNUM_ADS_TRACE(TRACE_OS_INFORMATION,
    ARGUMENT_STRING(ARG_ROLE_NAME, 3, "iOS"),
    ARGUMENT_FLOAT(ARG_ROLE_VERSION,
    [[[UIDevice currentDevice] systemVersion] doubleValue]));
  4. Relaying device data
    sternum_sdk_relay_device_data(DEVICE_TYPE_A, rawData, sizeof(rawData));

Please refer to sternum_sdk.h and sternum_trace_api.h for complete API documentation.