ParseAnalytics

public struct ParseAnalytics : ParseType, Hashable
extension ParseAnalytics: CustomDebugStringConvertible
extension ParseAnalytics: CustomStringConvertible

ParseAnalytics provides an interface to Parse’s logging and analytics backend.

  • The name of the custom event to report to Parse as having happened.

    Declaration

    Swift

    public var name: String
  • at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    Warning

    This will be deprecated in ParseSwift 5.0.0 in favor of date.

    Declaration

    Swift

    public var at: Date? { get set }
  • Explicitly set the time associated with a given event. If not provided the server time will be used.

    Declaration

    Swift

    public var date: Date?
  • The dictionary of information by which to segment this event.

    Declaration

    Swift

    public var dimensions: [String : Codable]? { get set }
  • Create an instance of ParseAnalytics for tracking.

    Declaration

    Swift

    public init (name: String,
                 dimensions: [String: Codable]? = nil,
                 at date: Date? = nil)

    Parameters

    name

    The name of the custom event to report to Parse as having happened.

    dimensions

    The dictionary of information by which to segment this event. Defaults to nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used. Defaults to nil.

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public static func == (lhs: `Self`, rhs: `Self`) -> Bool
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)

Intents

  • Tracks asynchronously this application being launched. If this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    static public func trackAppOpened(launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil,
                                      at date: Date? = nil,
                                      options: API.Options = [],
                                      callbackQueue: DispatchQueue = .main,
                                      completion: @escaping (Result<Void, ParseError>) -> Void)

    Parameters

    launchOptions

    The dictionary indicating the reason the application was launched, if any. This value can be found as a parameter to various UIApplicationDelegate methods, and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    A block that will be called when file deletes or fails. It should have the following argument signature: (Result<Void, ParseError>).

  • Tracks asynchronously this application being launched with additional dimensions.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    static public func trackAppOpened(dimensions: [String: String]? = nil,
                                      at date: Date? = nil,
                                      options: API.Options = [],
                                      callbackQueue: DispatchQueue = .main,
                                      completion: @escaping (Result<Void, ParseError>) -> Void)

    Parameters

    dimensions

    The dictionary of information by which to segment this event. Can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    A block that will be called when file deletes or fails. It should have the following argument signature: (Result<Void, ParseError>).

  • Tracks asynchronously the occurrence of a custom event.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    public func track(options: API.Options = [],
                      callbackQueue: DispatchQueue = .main,
                      completion: @escaping (Result<Void, ParseError>) -> Void)

    Parameters

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    A block that will be called when file deletes or fails. It should have the following argument signature: (Result<Void, ParseError>).

  • Tracks asynchronously the occurrence of a custom event with additional dimensions.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    public mutating func track(dimensions: [String: String]?,
                               at date: Date? = nil,
                               options: API.Options = [],
                               callbackQueue: DispatchQueue = .main,
                               completion: @escaping (Result<Void, ParseError>) -> Void)

    Parameters

    dimensions

    The dictionary of information by which to segment this event. Can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    A block that will be called when file deletes or fails. It should have the following argument signature: (Result<Void, ParseError>).

Aysnc/Await

  • Tracks asynchronously this application being launched. If this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push.

    Throws

    An error of type ParseError.

    Declaration

    Swift

    static func trackAppOpened(launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil,
                               at date: Date? = nil,
                               options: API.Options = []) async throws

    Parameters

    launchOptions

    The dictionary indicating the reason the application was launched, if any. This value can be found as a parameter to various UIApplicationDelegate methods, and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

  • Tracks asynchronously this application being launched. If this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push.

    Throws

    An error of type ParseError.

    Declaration

    Swift

    static func trackAppOpened(dimensions: [String: String]? = nil,
                               at date: Date? = nil,
                               options: API.Options = []) async throws

    Parameters

    dimensions

    The dictionary of information by which to segment this event and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

  • track(options:) Asynchronous

    Tracks asynchronously the occurrence of a custom event.

    Throws

    An error of type ParseError.

    Declaration

    Swift

    func track(options: API.Options = []) async throws

    Parameters

    options

    A set of header options sent to the server. Defaults to an empty set.

  • Tracks asynchronously the occurrence of a custom event with additional dimensions.

    Throws

    An error of type ParseError.

    Declaration

    Swift

    mutating func track(dimensions: [String: String]?,
                        at date: Date? = nil,
                        options: API.Options = []) async throws

    Parameters

    dimensions

    The dictionary of information by which to segment this event and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

Combine

  • Tracks asynchronously this application being launched. If this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push. Publishes when complete.

    Declaration

    Swift

    static func trackAppOpenedPublisher(launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil,
                                        at date: Date? = nil,
                                        options: API.Options = []) -> Future<Void, ParseError>

    Parameters

    launchOptions

    The dictionary indicating the reason the application was launched, if any. This value can be found as a parameter to various UIApplicationDelegate methods, and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Tracks asynchronously this application being launched. If this happened as the result of the user opening a push notification, this method sends along information to correlate this open with that push. Publishes when complete.

    Declaration

    Swift

    static func trackAppOpenedPublisher(dimensions: [String: String]? = nil,
                                        at date: Date? = nil,
                                        options: API.Options = []) -> Future<Void, ParseError>

    Parameters

    dimensions

    The dictionary of information by which to segment this event and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Tracks asynchronously the occurrence of a custom event. Publishes when complete.

    Declaration

    Swift

    func trackPublisher(options: API.Options = []) -> Future<Void, ParseError>

    Parameters

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Tracks asynchronously the occurrence of a custom event with additional dimensions. Publishes when complete.

    Warning

    This method makes a copy of the current ParseAnalytics and then mutates it. You will not have access to the mutated analytic after calling this method.

    Declaration

    Swift

    func trackPublisher(dimensions: [String: String]?,
                        at date: Date? = nil,
                        options: API.Options = []) -> Future<Void, ParseError>

    Parameters

    dimensions

    The dictionary of information by which to segment this event and can be empty or nil.

    at

    Explicitly set the time associated with a given event. If not provided the server time will be used.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }

CustomStringConvertible

  • Declaration

    Swift

    public var description: String { get }