forceVariant static method

Future<void> forceVariant(
  1. int variantId
)

Force a variant with the given id to be enabled.

Once forceVariant is called, Apptimize is placed in a special test mode where it will only enable variants that are forced by forceVariant. All other Feature Flags, A/B Experiments and Instant Updates will appear disabled/off unless a specific variant is forced for those projects.

The variant specified by variantId will be enabled.

Call forceVariant for each of the variants you want to apply. Call clearAllForcedVariants to return Apptimize to normal operation. Call clearForcedVariant to clear a single forced variant. Call getVariants to list all possible variants.

Implementation

static Future<void> forceVariant(int variantId) async {
  await _channel.invokeMethod('forceVariant', {'variantId': variantId});
}