PTAnalyticsHandlerAdapter
@interface PTAnalyticsHandlerAdapter : NSObject
This class is used to easily add an analytics framework to tools. Events of interest are be passed to (a subclass of) this generic class, and can then passed on to the analytics framework(s) of your choice.
-
Current instance of
PTAnalyticsHandlerAdapter
Declaration
Objective-C
+ (nonnull instancetype)getInstance;
Swift
class func getInstance() -> Self
-
Sets the instance of the
PTAnalyticsHandlerAdapter
.Declaration
Objective-C
+ (void)setInstance:(nonnull PTAnalyticsHandlerAdapter *)value;
Swift
class func setInstance(_ value: PTAnalyticsHandlerAdapter)
-
Sets a string for identifying the user.
Declaration
Objective-C
- (void)setUserIdentifier:(nonnull NSString *)identifier;
Swift
func setUserIdentifier(_ identifier: String)
Parameters
identifier
the string identifying the user.
-
Performs sdk specific initializations
Declaration
Objective-C
- (void)initializeHandler;
Swift
func initializeHandler()
-
Call in catch blocks so that the analytics handler can log exceptions.
Declaration
Objective-C
- (BOOL)logException:(nonnull NSException *)exception withExtraData:(nonnull NSDictionary *)extraData;
Swift
func logException(_ exception: NSException, withExtraData extraData: [AnyHashable : Any]) -> Bool
-
Call to register custom events with the analytics handler.
Declaration
Objective-C
- (BOOL)sendCustomEventWithTag:(nonnull NSString *)tag;
Swift
func sendCustomEvent(withTag tag: String) -> Bool