From 6d99b2df4a5b89ed76a387936418ca49a2868b8f Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Mon, 29 Nov 2021 12:17:57 -0800 Subject: [PATCH] Added alias to objective-c bridge --- Sources/Segment/ObjC/ObjCAnalytics.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/Segment/ObjC/ObjCAnalytics.swift b/Sources/Segment/ObjC/ObjCAnalytics.swift index 27a9bcaf..06097289 100644 --- a/Sources/Segment/ObjC/ObjCAnalytics.swift +++ b/Sources/Segment/ObjC/ObjCAnalytics.swift @@ -99,6 +99,14 @@ extension ObjCAnalytics { public func group(groupId: String, traits: [String: Any]?) { analytics.group(groupId: groupId, traits: traits) } + + @objc(alias:) + /// The alias method is used to merge two user identities, effectively connecting two sets of user data + /// as one. This is an advanced method, but it is required to manage user identities successfully in some of our destinations. + /// - Parameter newId: The new id replacing the old user id. + public func alias(newId: String) { + analytics.alias(newId: newId) + } } // MARK: - ObjC Peripheral Functionality