@@ -433,27 +433,26 @@ let RCNHTTPDefaultConnectionTimeout: TimeInterval = 60
433433
434434 if let userProperties, !userProperties. isEmpty {
435435 // Extract first open time from user properties and send as a separate field
436+ var remainingUserProperties = userProperties
436437 if let firstOpenTime = userProperties [ kRCNAnalyticsFirstOpenTimePropertyName] as? NSNumber {
437438 let date = Date ( timeIntervalSince1970: firstOpenTime. doubleValue / 1000 )
438439 let formatter = ISO8601DateFormatter ( )
439440 let firstOpenTimeISOString = formatter. string ( from: date)
440441 request += " , first_open_time:' \( firstOpenTimeISOString) ' "
441442
442- var remainingUserProperties = userProperties
443443 remainingUserProperties. removeValue ( forKey: kRCNAnalyticsFirstOpenTimePropertyName)
444-
445- if !remainingUserProperties. isEmpty {
446- do {
447- let jsonData = try JSONSerialization . data (
448- withJSONObject: remainingUserProperties,
449- options: [ ]
450- )
451- if let jsonString = String ( data: jsonData, encoding: . utf8) {
452- request += " , analytics_user_properties: \( jsonString) "
453- }
454- } catch {
455- // Ignore JSON serialization error.
444+ }
445+ if !remainingUserProperties. isEmpty {
446+ do {
447+ let jsonData = try JSONSerialization . data (
448+ withJSONObject: remainingUserProperties,
449+ options: [ ]
450+ )
451+ if let jsonString = String ( data: jsonData, encoding: . utf8) {
452+ request += " , analytics_user_properties: \( jsonString) "
456453 }
454+ } catch {
455+ // Ignore JSON serialization error.
457456 }
458457 }
459458 }
0 commit comments