Giter Club home page Giter Club logo

ios-tracker's Introduction

Full Documentation

Setting up tracker

Cocoapods home page

installation

Please make sure to use latest version. (check in tags)

Cocoapods

  pod 'OpenReplay', '~> 1.0.10'

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/openreplay/ios-tracker.git", from: "1.0.10"),
]
// AppDelegate.swift
import OpenReplay

//...

class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        OpenReplay.shared.serverURL = "https://your.instance.com/ingest"
        OpenReplay.shared.start(projectKey: "projectkey", options: .defaults)

        // ...
        return true
    }

Options (default all true)

let crashes: Bool
let analytics: Bool
let performances: Bool
let logs: Bool
let screen: Bool
let wifiOnly: Bool

Setting up touches listener

// SceneDelegate.Swift
import OpenReplay

// ...
    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        let contentView = ContentView()
            .environmentObject(TodoStore())

        if let windowScene = scene as? UIWindowScene {
            let window = TouchTrackingWindow(windowScene: windowScene) // <<<< here
            window.rootViewController = UIHostingController(rootView: contentView)
            self.window = window
            window.makeKeyAndVisible()
        }
    }

Adding sensitive views (will be blurred in replay)

import OpenReplay

// swiftUI
Text("Very important sensitive text")
    .sensitive()

// UIKit
OpenReplay.shared.addIgnoredView(view)

Adding tracked inputs

// swiftUI
TextField("Input", text: $text)
    .observeInput(text: $text, label: "tracker input #1", masked: Bool)

// UIKit will use placeholder as label and sender.isSecureTextEntry to mask the input
Analytics.shared.addObservedInput(inputEl)

Observing views

// swiftUI
TextField("Test")
  .observeView(title: "Screen title", viewName: "test input name")

// UIKit
Analytics.shared.addObservedView(view: inputEl, title: "Screen title", viewName: "test input name")

will send IOSScreenEnter and IOSScreenLeave when view appears/dissapears on/from screen

ios-tracker's People

Contributors

nick-delirium avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.