You can set up VWO Config while initializing your VWO SDK. This is helpful if you want to perform the following tasks:
VWOConfig *config = [VWOConfig new];
config.optOut = YES;
config.customVariables = @{@"user" : @"free"};
config.disablePreview = YES;
config.userID = "[email protected]";
[config setCustomDimension:@"key" withCustomDimensionValue:@"value"];
[VWO launchForAPIKey:@"<your-api-key>" config:config completion:^{
//Code executed after launch is complete
} failure:^(NSString * _Nonnull error) {
// Failure handling
}];
let config = VWOConfig();
config.optOut = true;
config.customVariables = ["user" : "free"];
config.disablePreview = true;
config.setCustomDimension(customDimensionKey: "VWO_CD_KEY", customDimensionValue: "CD_VALUE");
VWO.launch(apiKey: "<your-api-key>", config: config
completion: {
//Code executed after launch is complete
}, failure: { error in
print(error)
});
Configure VWO CDN for China
VWO initialization supports VWO Chinese CDN in order to prevent tracking calls being getting blocked in China. This can be achieved by configuring the SDK at the time of instantiating it.
VWOConfig *config = [VWOConfig new];
config.isChinaCDN = YES
config.userID = "[email protected]";
[VWO launchForAPIKey:@"<your-api-key>" config:config completion:^{
//Code executed after launch is complete
} failure:^(NSString * _Nonnull error) {
// Failure handling
}];
let config = VWOConfig();
config.isChinaCDN = true;
VWO.launch(apiKey: "<your-api-key>", config: config
completion: {
//Code executed after launch is complete
}, failure: { error in
print(error)
});