sixpack / sixpack-ios

iOS client library for SeatGeek's Sixpack A/B testing framework http://sixpack.seatgeek.com/
Other
12 stars 1 forks source link

- (void)participateIn:(NSString *)experiment onChoose:(void(^)(NSString *chosenAlternative))block; #2

Open iBlackStone opened 8 years ago

iBlackStone commented 8 years ago
[Sixpack participateIn:MY_EXPERIMENT onChoose:^(NSString *chosenAlternative) {

    [aView setTitle:chosenAlternative forState:UIControlStateNormal];
    if ([chosenAlternative isEqualToString:OPTION_A]) {
        aView.backgroundColor = [UIColor blackColor];
    } else if ([chosenAlternative isEqualToString:OPTION_B]) {
        aView.backgroundColor = [UIColor redColor];
    }
}];

when I use like this,I found the chosenAlternative is not the value which server tell me? I guess - (void)participateIn's block isn't calling in the currect time.Any ideas?

staminajim commented 8 years ago

Hi @StoneStoneStone , sorry this post slipped through the gaps. Had you called setupExperiment for the experiment in question before hand on application launch?