AnalyticsCategory

final public class AnalyticsCategory : Category
extension AnalyticsCategory: AnalyticsCategoryBehavior
extension AnalyticsCategory: DefaultLogger
extension AnalyticsCategory: Resettable

The Analytics category enables you to collect analytics data for your app.

Plugin handling

  • Adds plugin to the list of Plugins that implement functionality for this category.

    Declaration

    Swift

    public func add(plugin: AnalyticsCategoryPlugin) throws

    Parameters

    plugin

    The Plugin to add

  • Returns the added plugin with the specified key property.

    Declaration

    Swift

    public func getPlugin(for key: PluginKey) throws -> AnalyticsCategoryPlugin

    Parameters

    key

    The PluginKey (String) of the plugin to retrieve

    Return Value

    The wrapped plugin

  • Removes the plugin registered for key from the list of Plugins that implement functionality for this category. If no plugin has been added for key, no action is taken, making this method safe to call multiple times.

    Declaration

    Swift

    public func removePlugin(for key: PluginKey)

    Parameters

    key

    The key used to add the plugin

  • Declaration

    Swift

    public func identifyUser(userId: String, userProfile: AnalyticsUserProfile? = nil)
  • Declaration

    Swift

    public func record(event: AnalyticsEvent)
  • Declaration

    Swift

    public func record(eventWithName eventName: String)
  • Declaration

    Swift

    public func registerGlobalProperties(_ properties: AnalyticsProperties)
  • Declaration

    Swift

    public func unregisterGlobalProperties(_ keys: Set<String>? = nil)
  • Declaration

    Swift

    public func flushEvents()
  • Declaration

    Swift

    public func enable()
  • Declaration

    Swift

    public func disable()
  • Registered global properties can be unregistered though this method. In case no keys are provided, all registered global properties will be unregistered. Duplicate keys will be ignored. This method can be called from Amplify.Analytics and is a wrapper for unregisterGlobalProperties(_ keys: Set<String>? = nil)

    Declaration

    Swift

    public func unregisterGlobalProperties(_ keys: String...)

    Parameters

    keys

    one or more of property names to unregister

  • Registered global properties can be unregistered though this method. In case no keys are provided, all registered global properties will be unregistered. Duplicate keys will be ignored. This method can be called from Amplify.Analytics and is a wrapper for unregisterGlobalProperties(_ keys: Set<String>? = nil)

    Declaration

    Swift

    public func unregisterGlobalProperties(_ keys: [String])

    Parameters

    keys

    an array of property names to unregister

  • log

    Declaration

    Swift

    public static var log: Logger { get }
  • log

    Declaration

    Swift

    public var log: Logger { get }
  • reset() Asynchronous

    Declaration

    Swift

    public func reset() async