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.
-
Analytics category type
Declaration
Swift
public let categoryType: CategoryType
-
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 forkey
, 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 forunregisterGlobalProperties(_ 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 forunregisterGlobalProperties(_ keys: Set<String>? = nil)
Declaration
Swift
public func unregisterGlobalProperties(_ keys: [String])
Parameters
keys
an array of property names to unregister
-
Declaration
Swift
public static var log: Logger { get }
-
Declaration
Swift
public var log: Logger { get }
-
reset()
AsynchronousDeclaration
Swift
public func reset() async