1+ // swiftlint:disable file_length
2+
13//
24// PostHogSDK.swift
35// PostHogSDK
@@ -234,7 +236,7 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
234236 properties: [ String : Any ] ? ,
235237 userProperties: [ String : Any ] ? = nil ,
236238 userPropertiesSetOnce: [ String : Any ] ? = nil ,
237- groupProperties : [ String : Any ] ? = nil ,
239+ groups : [ String : String ] ? = nil ,
238240 appendSharedProps: Bool = true ) -> [ String : Any ]
239241 {
240242 var props : [ String : Any ] = [ : ]
@@ -257,10 +259,10 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
257259 if userPropertiesSetOnce != nil {
258260 props [ " $set_once " ] = ( userPropertiesSetOnce ?? [ : ] )
259261 }
260- if groupProperties != nil {
262+ if groups != nil {
261263 // $groups are also set via the dynamicContext
262- let currentGroups = props [ " $groups " ] as? [ String : Any ] ?? [ : ]
263- let mergedGroups = currentGroups. merging ( groupProperties ?? [ : ] ) { current, _ in current }
264+ let currentGroups = props [ " $groups " ] as? [ String : String ] ?? [ : ]
265+ let mergedGroups = currentGroups. merging ( groups ?? [ : ] ) { current, _ in current }
264266 props [ " $groups " ] = mergedGroups
265267 }
266268 }
@@ -396,22 +398,22 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
396398 }
397399
398400 @objc public func capture( _ event: String ) {
399- capture ( event, properties: nil , userProperties: nil , userPropertiesSetOnce: nil , groupProperties : nil )
401+ capture ( event, properties: nil , userProperties: nil , userPropertiesSetOnce: nil , groups : nil )
400402 }
401403
402404 @objc ( captureWithEvent: properties: )
403405 public func capture( _ event: String ,
404406 properties: [ String : Any ] ? = nil )
405407 {
406- capture ( event, properties: properties, userProperties: nil , userPropertiesSetOnce: nil , groupProperties : nil )
408+ capture ( event, properties: properties, userProperties: nil , userPropertiesSetOnce: nil , groups : nil )
407409 }
408410
409411 @objc ( captureWithEvent: properties: userProperties: )
410412 public func capture( _ event: String ,
411413 properties: [ String : Any ] ? = nil ,
412414 userProperties: [ String : Any ] ? = nil )
413415 {
414- capture ( event, properties: properties, userProperties: userProperties, userPropertiesSetOnce: nil , groupProperties : nil )
416+ capture ( event, properties: properties, userProperties: userProperties, userPropertiesSetOnce: nil , groups : nil )
415417 }
416418
417419 @objc ( captureWithEvent: properties: userProperties: userPropertiesSetOnce: )
@@ -420,7 +422,7 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
420422 userProperties: [ String : Any ] ? = nil ,
421423 userPropertiesSetOnce: [ String : Any ] ? = nil )
422424 {
423- capture ( event, properties: properties, userProperties: userProperties, userPropertiesSetOnce: userPropertiesSetOnce, groupProperties : nil )
425+ capture ( event, properties: properties, userProperties: userProperties, userPropertiesSetOnce: userPropertiesSetOnce, groups : nil )
424426 }
425427
426428 private func isOptOutState( ) -> Bool {
@@ -431,12 +433,12 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
431433 return false
432434 }
433435
434- @objc ( captureWithEvent: properties: userProperties: userPropertiesSetOnce: groupProperties : )
436+ @objc ( captureWithEvent: properties: userProperties: userPropertiesSetOnce: groups : )
435437 public func capture( _ event: String ,
436438 properties: [ String : Any ] ? = nil ,
437439 userProperties: [ String : Any ] ? = nil ,
438440 userPropertiesSetOnce: [ String : Any ] ? = nil ,
439- groupProperties : [ String : Any ] ? = nil )
441+ groups : [ String : String ] ? = nil )
440442 {
441443 if !isEnabled( ) {
442444 return
@@ -474,7 +476,7 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
474476 properties: sanitizeDicionary ( properties) ,
475477 userProperties: sanitizeDicionary ( userProperties) ,
476478 userPropertiesSetOnce: sanitizeDicionary ( userPropertiesSetOnce) ,
477- groupProperties : sanitizeDicionary ( groupProperties ) ,
479+ groups : groups ,
478480 appendSharedProps: !snapshotEvent)
479481 )
480482
@@ -1002,3 +1004,5 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30
10021004 }
10031005 #endif
10041006}
1007+
1008+ // swiftlint:enable file_length
0 commit comments