PyzeCustomEvent

@interface PyzeCustomEvent : NSObject

PyzeCustomEvent If the built in event classes do not serve the purpose of your requirement, you can use Custom Events.

  • Base class method which will post the data to server.

    Since

    v3.0.5

    Declaration

    Objective-C

    + (void)postWithEventName:(nonnull NSString *)eventName
               withAttributes:(nullable NSDictionary *)attributes;

    Swift

    class func post(withEventName eventName: String, withAttributes attributes: [AnyHashable : Any]? = nil)

    Parameters

    eventName

    The event name to capture.

    attributes

    Additional custom attributes the app would want to share with server.

  • Base class method which will post the data to server. When posting an event with attributes, use postWithEventName:withAttributes:

    Since

    v3.0.5

    See

    postWithEventName:withAttributes:

    Declaration

    Objective-C

    + (void)postWithEventName:(nonnull NSString *)eventName;

    Swift

    class func post(withEventName eventName: String)

    Parameters

    eventName

    The event name to capture.

  • Base class method which will post the data to server. If a non nil timer reference obtained by calling [Pyze timerReference] is passed in, the difference from this timer reference will be sent as an attribute elapsedSeconds with precision 3. e.g. 4.567 seconds (4567 milliseconds)

    //started uploading file 1
    double timerReference1 = [Pyze getTimerReference];
    
    sleep(1);
    
    //started uploading file 2
    double timerReference2 = [Pyze getTimerReference];
    
    void (^block)();
    
    block = ^void() {
    
    sleep(2);
    //second finished before first
    [PyzeCustomEvent postWithEventName:@“File Uploaded” withTimerReference: timerReference2];
    sleep(1);
    //first finished
    [PyzeCustomEvent postWithEventName:@“File Uploaded” withTimerReference: timerReference1];
    };
    block();
    

    Since

    v3.0.5

    Declaration

    Objective-C

    + (void)postTimedWithEventName:(nonnull NSString *)eventName
                withTimerReference:(double)timerReference
                    withAttributes:(nullable NSDictionary *)attributes;

    Swift

    class func postTimed(withEventName eventName: String, withTimerReference timerReference: Double, withAttributes attributes: [AnyHashable : Any]? = nil)

    Parameters

    eventName

    The event name to capture.

    timerReference

    reference time received by calling [Pyze timerReference] when you want to start timing

    attributes

    Additional custom attributes the app would want to share with server.

  • Base class method which will post the data to server.
    If a non nil timer reference obtained by calling [Pyze timerReference] is passed in, the difference from this timer reference will be sent as an attribute elapsedSeconds with precision 3. e.g. 4.567 seconds (4567 milliseconds) When posting an event with attributes, use postWithEventName:withAttributes:

    Since

    v3.0.5

    See

    +postWithEventName:

    See

    +postWithEventName:withAttributes:

    Declaration

    Objective-C

    + (void)postTimedWithEventName:(nonnull NSString *)eventName
                withTimerReference:(double)timerReference;

    Swift

    class func postTimed(withEventName eventName: String, withTimerReference timerReference: Double)

    Parameters

    eventName

    The event name to capture.

    timerReference

    reference time received by calling [Pyze timerReference]. Call [Pyze timerReference] when you want to start timing and this method to stop and report the elapsed time