Skip to content

Commit

Permalink
update device kit, add sessionid method
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-delirium committed Dec 2, 2024
1 parent f3014d4 commit e77c5d5
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Openreplay.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = 'Openreplay'
s.version = '1.0.13'
s.version = '1.0.14'
s.summary = 'IOS Library for Openreplay.'
s.homepage = 'https://github.com/openreplay/ios-tracker'
s.license = { :type => 'ELv2', :file => 'LICENSE.md' }
s.author = { 'Nick Delirium' => 'nikita@openreplay.com' }
s.source = { :git => 'https://github.com/openreplay/ios-tracker.git', :tag => s.version }
s.ios.deployment_target = '13.0'
s.swift_version = '5.0'
s.swift_version = '5.10'
s.source_files = 'Sources/OpenReplay/**/*'
s.dependency 'SWCompression'
s.dependency 'DeviceKit'
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
"location" : "https://github.com/devicekit/DeviceKit.git",
"state" : {
"revision" : "d37e70cb2646666dcf276d7d3d4a9760a41ff8a6",
"version" : "4.9.0"
"version" : "5.5.0"
}
},
{
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/devicekit/DeviceKit.git", from: "4.0.0"),
.package(url: "https://github.com/devicekit/DeviceKit.git", from: "5.5.0"),
.package(url: "https://github.com/tsolomko/SWCompression.git", .upToNextMajor(from: "4.8.5")),
],
targets: [
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -4,5 +4,5 @@ target 'Openreplay' do
use_frameworks!

pod 'SWCompression', '~> 4.8'
pod 'DeviceKit', '~> 5.1'
pod 'DeviceKit', '~> 5.5'
end
13 changes: 12 additions & 1 deletion Sources/OpenReplay/ORTracker.swift
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ open class Openreplay: NSObject {
@objc public static let shared = Openreplay()
public let userDefaults = UserDefaults(suiteName: "io.asayer.AsayerSDK-defaults")
public var projectKey: String?
public var pkgVersion = "1.1.10"
public var pkgVersion = "1.0.14"
private var sessionData: ORSessionResponse?
public var sessionStartTs: UInt64 = 0
public var trackerState = CheckState.unchecked
private var networkCheckTimer: Timer?
@@ -68,6 +69,7 @@ open class Openreplay: NSObject {
ORSessionRequest.create(doNotRecord: false) { sessionResponse in
guard let sessionResponse = sessionResponse else { return print("Openreplay: no response from /start request") }
self.sessionStartTs = UInt64(Date().timeIntervalSince1970 * 1000)
self.sessionData = sessionResponse
let captureSettings = getCaptureSettings(fps: 3, quality: "high") // getCaptureSettings(fps: sessionResponse.fps, quality: sessionResponse.quality)
ScreenshotManager.shared.setSettings(settings: captureSettings)

@@ -102,6 +104,7 @@ open class Openreplay: NSObject {
ORSessionRequest.create(doNotRecord: true) { sessionResponse in
guard let sessionResponse = sessionResponse else { return print("Openreplay: no response from /start request") }
self.sessionStartTs = UInt64(Date().timeIntervalSince1970 * 1000)
self.sessionData = sessionResponse
ConditionsManager.shared.getConditions(projectId: sessionResponse.projectID, token: sessionResponse.token)
let captureSettings = getCaptureSettings(fps: sessionResponse.fps, quality: sessionResponse.quality)

@@ -195,6 +198,14 @@ open class Openreplay: NSObject {
@objc open func networkRequest(url: String, method: String, requestJSON: String, responseJSON: String, status: Int, duration: UInt64) {
sendNetworkMessage(url: url, method: method, requestJSON: requestJSON, responseJSON: responseJSON, status: status, duration: duration)
}

@objc open func getSessionID() -> String {
if let sessionId = self.sessionData?.sessionID {
return sessionId
} else {
return ""
}
}
}


0 comments on commit e77c5d5

Please sign in to comment.