AnalyticsCategory
public final 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
pluginto the list of Plugins that implement functionality for this category.Declaration
Swift
public func add(plugin: AnalyticsCategoryPlugin) throwsParameters
pluginThe Plugin to add
-
Returns the added plugin with the specified
keyproperty.Declaration
Swift
public func getPlugin(for key: PluginKey) throws -> AnalyticsCategoryPluginParameters
keyThe PluginKey (String) of the plugin to retrieve
Return Value
The wrapped plugin
-
Removes the plugin registered for
keyfrom 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
keyThe key used to
addthe 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.Analyticsand is a wrapper forunregisterGlobalProperties(_ keys: Set<String>? = nil)Declaration
Swift
func unregisterGlobalProperties(_ keys: String...)Parameters
keysone 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.Analyticsand is a wrapper forunregisterGlobalProperties(_ keys: Set<String>? = nil)Declaration
Swift
func unregisterGlobalProperties(_ keys: [String])Parameters
keysan 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
View on GitHub