Skip to content

Commit

Permalink
chore: add the source ID to the register events API request (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
duyhungtnn committed Apr 23, 2024
1 parent 40bed43 commit 374218a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import Foundation

struct RegisterEventsRequestBody: Codable {
internal init(events: [Event] = [],
sdkVersion: String = Version.current,
sourceId: SourceID = SourceID.ios
) {
self.events = events
self.sdkVersion = sdkVersion
self.sourceId = sourceId
}

let events: [Event]
let sdkVersion: String
let sourceId: SourceID
}
6 changes: 4 additions & 2 deletions BucketeerTests/ApiClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class ApiClientTests: XCTestCase {
"type" : 3
}
],
"sdkVersion" : "\(Version.current)"
"sdkVersion" : "\(Version.current)",
"sourceId" : 2
}
"""
XCTAssertEqual(jsonString, expected)
Expand Down Expand Up @@ -360,7 +361,8 @@ class ApiClientTests: XCTestCase {
"type" : 3
}
],
"sdkVersion" : "\(Version.current)"
"sdkVersion" : "\(Version.current)",
"sourceId" : 2
}
"""
XCTAssertEqual(jsonString, expected)
Expand Down

0 comments on commit 374218a

Please sign in to comment.