Skip to content

Commit 450c2a1

Browse files
author
Niall Brennan
committed
Add alias method
1 parent ffea02f commit 450c2a1

File tree

1 file changed

+17
-0
lines changed
  • src/connections/sources/catalog/libraries/mobile/swift-ios

1 file changed

+17
-0
lines changed

src/connections/sources/catalog/libraries/mobile/swift-ios/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,23 @@ analytics.group(groupId: "user-123", traits: MyTraits(
186186
{% endcodeexampletab %}
187187
{% endcodeexample %}
188188

189+
### Alias
190+
The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. This is an advanced method, but can be used to manage user identities successfully in some of our destinations.
191+
When this method is called the `newId` value will overwrite the old userId. If no userId is currently set, the `newId` will be associated with future events as the userId. This is an advanced method and may not be supported across our destination catalog, please refer to our destination docs to understand if this method is supported or not.
192+
193+
{% codeexample %}
194+
{% codeexampletab Method signature %}
195+
```swift
196+
func alias(newId: String)
197+
```
198+
{% endcodeexampletab %}
199+
200+
{% codeexampletab Example use %}
201+
```swift
202+
analytics.alias(newId: "user-123")
203+
```
204+
{% endcodeexampletab %}
205+
{% endcodeexample %}
189206
## Plugin Architecture
190207
Segment's plugin architecture enables you to modify and augment how the analytics client works. From modifying event payloads to changing analytics functionality, plugins help to speed up the process of getting things done.
191208

0 commit comments

Comments
 (0)