PSPDFAnalytics

Objective-C


@interface PSPDFAnalytics : NSObject <PSPDFAnalyticsClient>

Swift

class PDFAnalytics : NSObject, PDFAnalyticsClient

This is a PSPDFKit provided PSPDFAnalyticsClient implementation that dispatches events to all registered clients. Events are dispatched on a background queue.

  • Events will be dispatched only if enabled is set to YES. Defaults to NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL enabled;

    Swift

    var enabled: Bool { get set }
  • Register your PSPDFAnalyticsClient instance to start receiving events.

    Declaration

    Objective-C

    - (void)addAnalyticsClient:(nonnull id<PSPDFAnalyticsClient>)analyticsClient;

    Swift

    func add(_ analyticsClient: PDFAnalyticsClient)
  • Unregister your PSPDFAnalyticsClient instance to stop receiving events.

    Declaration

    Objective-C

    - (void)removeAnalyticsClient:(nonnull id<PSPDFAnalyticsClient>)analyticsClient;

    Swift

    func remove(_ analyticsClient: PDFAnalyticsClient)
  • Convenience method for events without additional attributes.

    Declaration

    Objective-C

    - (void)logEvent:(nonnull PSPDFAnalyticsEventName)event;

    Swift

    func logEvent(_ event: PDFAnalytics.EventName)