Skip to content

Commit bf3c27c

Browse files
Merge pull request #6475 from segmentio/ashton-huxtable-patch-3
Add section on anonymousId config option
2 parents b9df23e + a61328e commit bf3c27c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/connections/sources/catalog/libraries/mobile/apple/implementation.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,5 +353,24 @@ var body: some Scene {
353353
```
354354
If you call this method with a valid URL parameter, a Segment `Deep Link Opened` track event triggers.
355355

356+
## Configuration options
357+
358+
### anonymousIdGenerator
359+
To generate custom anonymousIds instead of relying on the ones Segment creates, you can use the following configuration option:
360+
```swift
361+
class MyAnonymousIdGenerator: AnonymousIdGenerator {
362+
func newAnonymousId -> String {
363+
return UUID.uuidString
364+
}
365+
}
366+
367+
// in the apps config:
368+
let config = Configuration(writeKey: "WRITEKEY")
369+
.anonymousIdGenerator(MyAnonymousIdGenerator())
370+
371+
let analytics = Analytics(configuration: config)
372+
373+
```
374+
356375
## Changelog
357376
[View the Analytics Swift changelog on GitHub](https://github.com/segmentio/analytics-swift/releases){:target="_blank"}. -->

0 commit comments

Comments
 (0)