From 8ea23bc29114184b945a6ddef4bab93acc383ae6 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:49:31 +0200 Subject: [PATCH] add missing capture method for objC with groups overload (#217) * add missing capture method for objC with groups overload * fix --- CHANGELOG.md | 2 ++ PostHog/PostHogSDK.swift | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c79b6..4d44cff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Next +- add missing capture method for objC with groups overload ([#217](https://github.com/PostHog/posthog-ios/pull/217)) + ## 3.13.1 - 2024-10-16 - add optional distinctId parameter to capture methods ([#216](https://github.com/PostHog/posthog-ios/pull/216)) diff --git a/PostHog/PostHogSDK.swift b/PostHog/PostHogSDK.swift index 2674856..971ab08 100644 --- a/PostHog/PostHogSDK.swift +++ b/PostHog/PostHogSDK.swift @@ -475,7 +475,7 @@ let maxRetryDelay = 30.0 } @objc public func capture(_ event: String) { - capture(event, properties: nil, userProperties: nil, userPropertiesSetOnce: nil, groups: nil) + capture(event, distinctId: nil, properties: nil, userProperties: nil, userPropertiesSetOnce: nil, groups: nil) } @objc(captureWithEvent:properties:) @@ -510,6 +510,16 @@ let maxRetryDelay = 30.0 return false } + @objc(captureWithEvent:properties:userProperties:userPropertiesSetOnce:groups:) + public func capture(_ event: String, + properties: [String: Any]? = nil, + userProperties: [String: Any]? = nil, + userPropertiesSetOnce: [String: Any]? = nil, + groups: [String: String]? = nil) + { + capture(event, distinctId: nil, properties: properties, userProperties: userProperties, userPropertiesSetOnce: userPropertiesSetOnce, groups: groups) + } + @objc(captureWithEvent:distinctId:properties:userProperties:userPropertiesSetOnce:groups:) public func capture(_ event: String, distinctId: String? = nil,