FBUser #407
-
When trying to use client.BoolVariationDetail, why can't I pass in a null for the user? I don't have any user filters in the featureflag. Perhaps just have the various functions overridden on the user too so we don't have to pass it in, the same as the defaultValue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @thanh81, Thank you for your question. The In your case, I would suggest you define a default user within your application and use that user in your codebase, maybe something like this: public static readonly FbUser FbDefaultUser = FbUser.Builder("default-user-id").Name("default").Build(); Or we define a built-in default user in FbUser.cs, so we can use public static readonly FbUser Default = Builder("default-user-id").Name("default").Build(); |
Beta Was this translation helpful? Give feedback.
Hi @thanh81,
Thank you for your question. The
FbUser
parameter is required and cannot be null when we doVariation
calls. This is because we rely on the user context to evaluate the flag value and record insights related to the flag.In your case, I would suggest you define a default user within your application and use that user in your codebase, maybe something like this:
Or we define a built-in default user in FbUser.cs, so we can use
FbUser.Default
.