@@ -35,10 +35,12 @@ extension Analytics {
35
35
36
36
/// Associate a user with their unique ID and record traits about them.
37
37
/// - Parameters:
38
- /// - userId: A database ID (or email address) for this user. If you don't have a userId
39
- /// but want to record traits, you should pass nil. For more information on how we
40
- /// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
41
- /// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
38
+ /// - userId: A database ID for this user. If you don't have a userId
39
+ /// but want to record traits, just pass traits into the event and they will be associated
40
+ /// with the anonymousId of that user. For more information on how we
41
+ /// generate the UUID and Apple's policies on IDs, see
42
+ /// https://segment.io/libraries/ios#ids
43
+ /// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
42
44
public func identify< T: Codable > ( userId: String , traits: T ? ) {
43
45
do {
44
46
if let traits = traits {
@@ -72,7 +74,7 @@ extension Analytics {
72
74
73
75
/// Associate a user with their unique ID and record traits about them.
74
76
/// - Parameters:
75
- /// - userId: A database ID (or email address) for this user.
77
+ /// - userId: A database ID for this user.
76
78
/// For more information on how we generate the UUID and Apple's policies on IDs, see
77
79
/// https://segment.io/libraries/ios#ids
78
80
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
@@ -132,9 +134,11 @@ extension Analytics {
132
134
extension Analytics {
133
135
/// Associate a user with their unique ID and record traits about them.
134
136
/// - Parameters:
135
- /// - userId: A database ID (or email address) for this user. If you don't have a userId
136
- /// but want to record traits, you should pass nil. For more information on how we
137
- /// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
137
+ /// - userId: A database ID for this user. If you don't have a userId
138
+ /// but want to record traits, just pass traits into the event and they will be associated
139
+ /// with the anonymousId of that user. For more information on how we
140
+ /// generate the UUID and Apple's policies on IDs, see
141
+ /// https://segment.io/libraries/ios#ids
138
142
/// - properties: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
139
143
public func track( name: String , properties: [ String : Any ] ? = nil ) {
140
144
var props : JSON ? = nil
@@ -151,9 +155,11 @@ extension Analytics {
151
155
152
156
/// Associate a user with their unique ID and record traits about them.
153
157
/// - Parameters:
154
- /// - userId: A database ID (or email address) for this user.
155
- /// For more information on how we generate the UUID and Apple's policies on IDs, see
156
- /// https://segment.io/libraries/ios#ids
158
+ /// - userId: A database ID for this user. If you don't have a userId
159
+ /// but want to record traits, just pass traits into the event and they will be associated
160
+ /// with the anonymousId of that user. For more information on how we
161
+ /// generate the UUID and Apple's policies on IDs, see
162
+ /// https://segment.io/libraries/ios#ids
157
163
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
158
164
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
159
165
public func identify( userId: String , traits: [ String : Any ] ? = nil ) {
0 commit comments