File tree 3 files changed +5
-3
lines changed
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public class Context: PlatformPlugin {
13
13
14
14
internal var staticContext = staticContextData ( )
15
15
internal static var device = VendorSystem . current
16
+ internal let instanceId = UUID ( ) . uuidString
16
17
17
18
public func execute< T: RawEvent > ( event: T ? ) -> T ? {
18
19
guard var workingEvent = event else { return event }
@@ -21,6 +22,9 @@ public class Context: PlatformPlugin {
21
22
22
23
insertDynamicPlatformContextData ( context: & context)
23
24
25
+ // add instanceId to the context
26
+ context [ " instanceId " ] = instanceId
27
+
24
28
// if this event came in with context data already
25
29
// let it take precedence over our values.
26
30
if let eventContext = workingEvent. context? . dictionaryValue {
@@ -42,7 +46,7 @@ public class Context: PlatformPlugin {
42
46
// library name
43
47
staticContext [ " library " ] = [
44
48
" name " : " analytics-swift " ,
45
- " version " : __segment_version
49
+ " version " : __segment_version,
46
50
]
47
51
48
52
// app info
Original file line number Diff line number Diff line change @@ -157,7 +157,6 @@ extension HTTPClient {
157
157
var request = URLRequest ( url: url, cachePolicy: . reloadIgnoringLocalCacheData, timeoutInterval: 60 )
158
158
request. httpMethod = method
159
159
request. addValue ( " application/json; charset=utf-8 " , forHTTPHeaderField: " Content-Type " )
160
- request. addValue ( " Basic \( apiKey) " , forHTTPHeaderField: " Authorization " )
161
160
request. addValue ( " analytics-ios/ \( Analytics . version ( ) ) " , forHTTPHeaderField: " User-Agent " )
162
161
request. addValue ( " gzip " , forHTTPHeaderField: " Accept-Encoding " )
163
162
Original file line number Diff line number Diff line change @@ -536,7 +536,6 @@ final class Analytics_Tests: XCTestCase {
536
536
let config = Configuration ( writeKey: " testSequential " ) . requestFactory { request in
537
537
XCTAssertEqual ( request. value ( forHTTPHeaderField: " Accept-Encoding " ) , " gzip " )
538
538
XCTAssertEqual ( request. value ( forHTTPHeaderField: " Content-Type " ) , " application/json; charset=utf-8 " )
539
- XCTAssertEqual ( request. value ( forHTTPHeaderField: " Authorization " ) , " Basic testSequential " )
540
539
XCTAssertTrue ( request. value ( forHTTPHeaderField: " User-Agent " ) !. contains ( " analytics-ios/ " ) )
541
540
return request
542
541
} . errorHandler { error in
You can’t perform that action at this time.
0 commit comments