ApptimizeTestInfo

@protocol ApptimizeTestInfo <NSObject>

Information about a single A/B test or feature flag this device is enrolled in.

  • Declaration

    Objective-C

    - (nonnull NSString *)testName;

    Swift

    func testName() -> String

    Return Value

    The name of the test.

  • Declaration

    Objective-C

    - (nonnull NSString *)enrolledVariantName;

    Swift

    func enrolledVariantName() -> String

    Return Value

    The name of the variant of the test that this device is enrolled in.

  • Declaration

    Objective-C

    - (nonnull NSNumber *)testID;

    Swift

    func testID() -> NSNumber

    Return Value

    The unique numeric ID of the test.

  • Declaration

    Objective-C

    - (nonnull NSNumber *)enrolledVariantID;

    Swift

    func enrolledVariantID() -> NSNumber

    Return Value

    The unique numeric ID of the currently enrolled test variant.

  • Note: this is the time as reported by Apptimize’s servers and is not affected by changes in the device’s clock.

    Declaration

    Objective-C

    - (nonnull NSDate *)testStartedDate;

    Swift

    func testStartedDate() -> Date

    Return Value

    The date this Apptimize test was started.

  • Note: unlike the return value for testStartedDate, this is the time as reported by the device, and not the time as reported by Apptimize’s server. This difference is relevant if the device’s clock is inaccurate.

    Declaration

    Objective-C

    - (nonnull NSDate *)testEnrolledDate;

    Swift

    func testEnrolledDate() -> Date

    Return Value

    The date this device was enrolled into this test.

  • Declaration

    Objective-C

    - (nonnull NSNumber *)cycle;

    Swift

    func cycle() -> NSNumber

    Return Value

    The cycle ID of this test. This is 1 if it’s the initial test run, and increments by 1 each time the test is restarted or for if a non-proportional allocation change is made.

  • Declaration

    Objective-C

    - (nonnull NSNumber *)currentPhase;

    Swift

    func currentPhase() -> NSNumber

    Return Value

    The current phase of this test. This is 1 if the test has not been modified since creation, and increments by 1 each time the test is modified (such as when the test’s allocations have been changed). The phase ID does not reset when a test is restarted.

  • Declaration

    Objective-C

    - (nonnull NSNumber *)participationPhase;

    Swift

    func participationPhase() -> NSNumber

    Return Value

    The first phase in which this device participated in this test for this cycle. If this test has not been participated in during this cycle, this value will be 0.

  • Returns whether the user has participated in this test in this cycle since enrollment.

    • For code block tests, this indicates that a codeblock has been executed for this test.
    • For visual tests, this indicates that at least one changed element has been seen.
    • For dynamic variable tests, this indicates that the value of a variable has been queried.

    Declaration

    Objective-C

    - (BOOL)userHasParticipated;

    Swift

    func userHasParticipated() -> Bool

    Return Value

    Returns YES if the user has participated in this test, or NO if they have not.

  • Declaration

    Objective-C

    - (nullable NSString *)userID;

    Swift

    func userID() -> String?

    Return Value

    The user id of the currently enrolled user. If the user has not been set then the anonymous user id is used.

  • Declaration

    Objective-C

    - (nonnull NSString *)anonymousUserID;

    Swift

    func anonymousUserID() -> String

    Return Value

    The anonymous user id currently assigned to this apptimize instance.

  • Declaration

    Objective-C

    - (ExperimentType)experimentType;

    Swift

    func experimentType() -> ExperimentType

    Return Value

    The experiment type this test info represents.