Openreplay 1.0.11

Openreplay 1.0.11

Nick.Delirium维护。



 
依赖于
SWCompression>= 0
DeviceKit>= 0
 

Openreplay 1.0.11

  • Nick Delirium

设置追踪器

Cocoapods主页

安装

请确保使用最新版本。

Cocoapods

  pod 'OpenReplay', '~> 1.0.5'

Swift包管理器

dependencies: [
    .package(url: "https://github.com/openreplay/ios-tracker.git", from: "1.0.5"),
]
// 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
    }

选项(默认全部为true

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

设置触摸监听器

// 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()
        }
    }

添加敏感视图(在回放时将变得模糊)

import OpenReplay

// swiftUI
Text("Very important sensitive text")
    .sensitive()
    
// UIKit
OpenReplay.shared.addIgnoredView(view)

添加跟踪输入

// 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)

观察视图

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

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

当视图出现在屏幕上/从屏幕消失时,将发送IOSScreenEnter和IOSScreenLeave