Skip to content

Identify docs fix #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions Sources/Segment/Events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ extension Analytics {

/// Associate a user with their unique ID and record traits about them.
/// - Parameters:
/// - userId: A database ID (or email address) for this user. If you don't have a userId
/// but want to record traits, you should pass nil. For more information on how we
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
/// - userId: A database ID for this user. If you don't have a userId
/// but want to record traits, just pass traits into the event and they will be associated
/// with the anonymousId of that user. For more information on how we
/// generate the UUID and Apple's policies on IDs, see
/// https://segment.io/libraries/ios#ids
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
public func identify<T: Codable>(userId: String, traits: T?) {
do {
if let traits = traits {
Expand Down Expand Up @@ -72,7 +74,7 @@ extension Analytics {

/// Associate a user with their unique ID and record traits about them.
/// - Parameters:
/// - userId: A database ID (or email address) for this user.
/// - userId: A database ID for this user.
/// For more information on how we generate the UUID and Apple's policies on IDs, see
/// https://segment.io/libraries/ios#ids
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
Expand Down Expand Up @@ -132,9 +134,11 @@ extension Analytics {
extension Analytics {
/// Associate a user with their unique ID and record traits about them.
/// - Parameters:
/// - userId: A database ID (or email address) for this user. If you don't have a userId
/// but want to record traits, you should pass nil. For more information on how we
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
/// - userId: A database ID for this user. If you don't have a userId
/// but want to record traits, just pass traits into the event and they will be associated
/// with the anonymousId of that user. For more information on how we
/// generate the UUID and Apple's policies on IDs, see
/// https://segment.io/libraries/ios#ids
/// - properties: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
public func track(name: String, properties: [String: Any]? = nil) {
var props: JSON? = nil
Expand All @@ -151,9 +155,11 @@ extension Analytics {

/// Associate a user with their unique ID and record traits about them.
/// - Parameters:
/// - userId: A database ID (or email address) for this user.
/// For more information on how we generate the UUID and Apple's policies on IDs, see
/// https://segment.io/libraries/ios#ids
/// - userId: A database ID for this user. If you don't have a userId
/// but want to record traits, just pass traits into the event and they will be associated
/// with the anonymousId of that user. For more information on how we
/// generate the UUID and Apple's policies on IDs, see
/// https://segment.io/libraries/ios#ids
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
public func identify(userId: String, traits: [String: Any]? = nil) {
Expand Down