Hi there, may I know when this code will be called...
# ask-questions
c
Hi there, may I know when this code will be called?
Copy code
growthBookTrackingCallBack: (gbExperiment, gbExperimentResult) {}
Because I was tried to assigned user to specific value, that method never called. Thanks.
f
Which SDK is that? It should be called when a user is assigned to a variation within an experiment
happy to help you debug if you share more of the code
c
I use Flutter SDK @fresh-football-47124
I was intance an Growthbook SDK via wrapper using this code
Copy code
GrowthBook(
        apiHost: F.growthBookApiHost,
        apiKey: growthBookApiKey,
        isQAMode: (F.appFlavor == Flavor.staging),
        trackingCallback: (experiment, result) {
          // any tracker method
        },
      ),
Then in specific page, I was get assigned value using this code
Copy code
const id = 'pdp-palingmurah';
    final feature = _growthBook.instance.feature(id);

    if (feature.value == 'PDP-Title') {
      _cheapestBadge.value = CheapestType.title;
    } else if (feature.value == 'PDP-Price') {
      _cheapestBadge.value = CheapestType.price;
    }
f
and how were you testing it?
c
When I access that page, the callback above never called. I was added breakpoint
f
are you setting the user attributes?
c
Yes I setting the user attributes after login
The instance called before login method executed
f
Can you debug what the feature(id) is returning?
c
Yes @fresh-football-47124 I receive assigned value. In several account I use forced value. When I debug and trial the app. The value assigned based on forced value assigned.
f
okay, for forced values, that tracking callback wont be called
c
I see. So, if I want to check the callback, I need to use an user that not registered in forced value?
f
yes, you need to have a user that will be included in an experiment
c
Ok @fresh-football-47124 thanks for the information I will try with another user.
👍 1
f
you could also remove the force rule
c
Hi @fresh-football-47124 I was test using another account but the value always assigned using default value. I try set default value with variation 1, user will received variation 1. Then, I change default value with variation 2, user will recieved variation 2. What should I do?
f
can you share the rules?
c
This is the rule @fresh-football-47124
f
is the ID being set before the feature is evaluated?
c
Yes I was instance the GrowthBook first after main.dart called. Then id wil be set after login. So, before login, we set empty map.
f
I have a feeling that it’s not correctly updating the attributes so it’s serving the default value
Can you debug what the
final feature
is set to?
c
Wait, I will try with always setup attributes when load the app
Hi @fresh-football-47124 this is the result
The source name always
defaultValue
Hi @fresh-football-47124 after disabled QA mode, I got different value. Thanks for your support 🙏
f
nice