This API causes the SDK to download the configuration for the provided app ID and apply the configuration to the current session.
{% tabs %}
This API causes the SDK to download the configuration for the provided app ID and apply the configuration to the current session.
public static void configureWithAppID(final String appId);
MobileCore.configureWithAppId("1423ae38-8385-8963-8693-28375403491d");
+ (void) configureWithAppId: (NSString* __nullable) appid;
[ACPCore configureWithAppId:@"1423ae38-8385-8963-8693-28375403491d"];
ACPCore.configure(withAppId: "1423ae38-8385-8963-8693-28375403491d")
{% tabs %} {% tab title="Unity" %}
public static void ConfigureWithAppID(string appId)
ACPCore.ConfigureWithAppID("1423ae38-8385-8963-8693-28375403491d");
{% endtab %} {% endtabs %}
You can also update the configuration programmatically by passing configuration keys and values to override the existing configuration.
{% hint style="info" %} Keys that are not found on the current configuration are added when this method is followed. Null values are allowed and replace existing configuration values. {% endhint %}
{% hint style="warning" %} Do not use this API to update the build.environment or any key with an environment prefix, because it can lead to unexpected behaviors. For more information, read Environment-aware configuration properties. {% endhint %}
{% tabs %} {% tab title="Android" %}
public static void updateConfiguration(final Map configMap);
HashMap<String, Object> data = new HashMap<String, Object>();
data.put("global.privacy", "optedout");
MobileCore.updateConfiguration(data);
{% endtab %}
{% tab title="iOS" %}
+ (void) updateConfiguration: (NSDictionary* __nullable) config;
NSDictionary *updatedConfig = @{@"global.privacy":@"optedout"};
[ACPCore updateConfiguration:updatedConfig];
let updatedConfig = ["global.privacy":"optedout"]
ACPCore.updateConfiguration(updatedConfig)
{% endtab %}
{% tab title="React Native" %}
ACPCore.updateConfiguration({"global.privacy":"optedout"});
{% endtab %}
{% tab title="Flutter" %}
FlutterACPCore.updateConfiguration({"global.privacy":"optedout"});
{% endtab %}
{% tab title="Cordova" %}
Update SDK configuration
ACPCore.updateConfiguration({"newConfigKey":"newConfigValue"}, successCallback, errorCallback);
{% endtab %}
{% tab title="Unity" %}
Update SDK configuration
var dict = new Dictionary<string, object>();
dict.Add("newConfigKey", "newConfigValue");
ACPCore.UpdateConfiguration(dict);
{% endtab %} {% endtabs %}
You can include a bundled JSON configuration file in your app package to replace or complement the configuration that was downloaded by using the Configure with Launch App ID approach.
To pass in a bundled path and file name:
{% tabs %} {% tab title="Android" %}
public static void configureWithFileInPath(final String filePath);
MobileCore.configureWithFileInPath("absolute/path/to/exampleJSONfile.json");
{% endtab %}
{% tab title="iOS" %}
+ (void) configureWithFileInPath: (NSString* __nullable) filepath;
Objective-C
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"ExampleJSONFile"ofType:@"json"];
[ACPCore configureWithFileInPath:filePath];
Swift
let filePath = Bundle.main.path(forResource: "ExampleJSONFile", ofType: "json")
ACPCore.configureWithFile(inPath: filePath)
{% endtab %} {% endtabs %}