PTAnalyticsHandler

@protocol PTAnalyticsHandler <NSObject>

Classes conforming to the PTAnalyticsHandler protocol receive analytics events when registered with a PTAnalyticsManager instance.

  • Call in catch blocks so that the analytics handler can log exceptions.

    Declaration

    Objective-C

    - (BOOL)logException:(nonnull NSException *)exception
           withExtraData:(nullable NSDictionary<id, id> *)extraData;

    Swift

    optional func logException(_ exception: NSException, withExtraData extraData: [AnyHashable : Any]?) -> Bool
  • Call to send custom events with the analytics handler.

    Declaration

    Objective-C

    - (BOOL)sendCustomEventWithTag:(nonnull NSString *)tag;

    Swift

    optional func sendCustomEvent(withTag tag: String) -> Bool
  • Call to log an event with the analytics handler.

    Declaration

    Objective-C

    - (void)logEvent:(nonnull NSString *)eventDescription
        withCategory:(nullable PTAnalyticsEventCategory)category;

    Swift

    optional func logEvent(_ eventDescription: String, withCategory category: PTAnalyticsEventCategory?)

    Parameters

    eventDescription

    A description of the event that has occurred.

    category

    The category of the event, or nil.