Client Swift Installation

Installation

Using Swift package manager

Add dependency into Package.swift

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "swift",
    dependencies: [
        // Add dependency
        .package(name: "Footprint",
            url: "https://git.teko.vn/data/footprint/footprint-dto.git",
            from: "0.17.4" // Change version if it needed
        )
    ],
    targets: [
        .target(
            name: "swift",
            dependencies: ["Footprint"]), // Add dependency
        .testTarget(
            name: "swiftTests",
            dependencies: ["swift"]),
    ]
)

Using CocoaPod

Add source to top of Podfile and add this pod to dependencies:

source 'https://github.com/teko-vn/Specs-ios.git'
source 'https://github.com/CocoaPods/Specs.git'
...
pod 'Footprint'

Then run pod install

How to use

Example

import Footprint

// Create an event
var event: Tracking_V3_AlertEvent = Tracking_V3_AlertEvent()
event.appID = "Hello word"
event.schemaName = "23213"

// Wrap event into an LogEntry instance
var timestampMillis: Int64 = 1605839389173 // Just an random timestamp
var logEntry = event.toLogEntry(at: timestampMillis)


// Next, serialize logEntry instance into json format and send it to server.