Configuration API reference
This document lists information about the previous versions of the Adobe Experience Platform Mobile SDKs. Check out this page for latest versions and solution support of the Mobile SDKs.
configureWithAppID
This API causes the SDK to download the configuration for the provided app ID and apply the configuration to the current session.
Swift
Syntax
Copied to your clipboardstatic func configure(withAppId: String)
Example
Copied to your clipboardACPCore.configure(withAppId: "1423ae38-8385-8963-8693-28375403491d")
Objective-C
Syntax
Copied to your clipboard+ (void) configureWithAppId: (NSString* __nullable) appid;
Example
Copied to your clipboard[ACPCore configureWithAppId:@"1423ae38-8385-8963-8693-28375403491d"];
Java
Syntax
Copied to your clipboardpublic static void configureWithAppID(final String appId);
Example
Copied to your clipboardMobileCore.configureWithAppId("1423ae38-8385-8963-8693-28375403491d");
Swift
Syntax
Copied to your clipboardstatic func configure(withAppId: String)
Example
Copied to your clipboardACPCore.configure(withAppId: "1423ae38-8385-8963-8693-28375403491d")
Objective-C
Syntax
Copied to your clipboard+ (void) configureWithAppId: (NSString* __nullable) appid;
Example
Copied to your clipboard[ACPCore configureWithAppId:@"1423ae38-8385-8963-8693-28375403491d"];
configureWithFileInAssets
This API is only available in Android and was added in Android was added in Android Core version 1.7.0.
You can bundle a JSON configuration file in the app's Assets folder to replace or complement the configuration that was downloaded by using the Configure with App ID per environment approach.
configureWithFileInPath
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 App ID per environment approach.
To pass in a bundled path and file name:
Swift
Syntax
Copied to your clipboardstatic func configureWithFile(inPath: String)
Example
Copied to your clipboardlet filePath = Bundle.main.path(forResource: "ExampleJSONFile", ofType: "json")ACPCore.configureWithFile(inPath: filePath)
Objective-C
Syntax
Copied to your clipboard+ (void) configureWithFileInPath: (NSString* __nullable) filepath;
Example
Copied to your clipboardNSString *filePath = [[NSBundle mainBundle] pathForResource:@"ExampleJSONFile"ofType:@"json"];[ACPCore configureWithFileInPath:filePath];
C#
Android syntax
Copied to your clipboardpublic unsafe static void ConfigureWithFileInPath (string filepath);
iOS syntax
Copied to your clipboardpublic static void ConfigureWithFileInPath (string filepath);
Example
Copied to your clipboardACPCore.ConfigureWithFileInPath("absolute/path/to/exampleJSONfile.json");
Java
Syntax
Copied to your clipboardpublic static void configureWithFileInPath(final String filePath);
Example
Copied to your clipboardMobileCore.configureWithFileInPath("absolute/path/to/exampleJSONfile.json");
Swift
Syntax
Copied to your clipboardstatic func configureWithFile(inPath: String)
Example
Copied to your clipboardlet filePath = Bundle.main.path(forResource: "ExampleJSONFile", ofType: "json")ACPCore.configureWithFile(inPath: filePath)
Objective-C
Syntax
Copied to your clipboard+ (void) configureWithFileInPath: (NSString* __nullable) filepath;
Example
Copied to your clipboardNSString *filePath = [[NSBundle mainBundle] pathForResource:@"ExampleJSONFile"ofType:@"json"];[ACPCore configureWithFileInPath:filePath];
C#
Android syntax
Copied to your clipboardpublic unsafe static void ConfigureWithFileInPath (string filepath);
iOS syntax
Copied to your clipboardpublic static void ConfigureWithFileInPath (string filepath);
Example
Copied to your clipboardACPCore.ConfigureWithFileInPath("absolute/path/to/exampleJSONfile.json");
extensionVersion
The extensionVersion()
API returns the version of the Configuration extension.
To get the version of the Configuration extension, use the following code sample:
Swift
Copied to your clipboardlet coreExtensionVersion = ACPCore.extensionVersion()
Objective-C
Copied to your clipboardNSString *coreExtensionVersion = [ACPCore extensionVersion];
JavaScript
Copied to your clipboardACPCore.extensionVersion().then(coreExtensionVersion => console.log("AdobeExperienceSDK: ACPCore version: " + coreExtensionVersion));
updateConfiguration
You can also update the configuration programmatically by passing configuration keys and values to override the existing configuration.
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.
Do not use this API to update the build.environment
key or any key with an environment prefix, because it can lead to unexpected behaviors. For more information, read Environment-aware configuration properties.
Swift
Syntax
Copied to your clipboardstatic func updateConfiguration(_: [String: Any])
Example
Copied to your clipboardlet updatedConfig = ["global.privacy":"optedout"]ACPCore.updateConfiguration(updatedConfig)
Objective-C
Syntax
Copied to your clipboard+ (void) updateConfiguration: (NSDictionary* __nullable) config;
Example
Copied to your clipboardNSDictionary *updatedConfig = @{@"global.privacy":@"optedout"};[ACPCore updateConfiguration:updatedConfig];
C#
Syntax
Copied to your clipboardvoid UpdateConfiguration([NullAllowed] NSDictionary config);
iOS example
Copied to your clipboardvar config = new NSMutableDictionary<NSString, NSObject>{["newConfigKey"] = new NSString("newConfigValue")};ACPCore.UpdateConfiguration(config);
Android example
Copied to your clipboardvar config = new Dictionary<string, Java.Lang.Object>();config.Add("newConfigKey", "newConfigValue");ACPCore.UpdateConfiguration(config);
Java
Syntax
Copied to your clipboardpublic static void updateConfiguration(final Map configMap);
Example
Copied to your clipboardHashMap<String, Object> data = new HashMap<String, Object>();data.put("global.privacy", "optedout");MobileCore.updateConfiguration(data);
Swift
Syntax
Copied to your clipboardstatic func updateConfiguration(_: [String: Any])
Example
Copied to your clipboardlet updatedConfig = ["global.privacy":"optedout"]ACPCore.updateConfiguration(updatedConfig)
Objective-C
Syntax
Copied to your clipboard+ (void) updateConfiguration: (NSDictionary* __nullable) config;
Example
Copied to your clipboardNSDictionary *updatedConfig = @{@"global.privacy":@"optedout"};[ACPCore updateConfiguration:updatedConfig];
JavaScript
Syntax
Copied to your clipboardupdateConfiguration(configMap?: { string: any })
Example
Copied to your clipboardACPCore.updateConfiguration({"global.privacy":"optedout"});
Dart
Syntax
Copied to your clipboardstatic Future<void> updateConfiguration(Map<String, Object> configMap);
Example
Copied to your clipboardFlutterACPCore.updateConfiguration({"global.privacy":"optedout"});
Javascript
Copied to your clipboardACPCore.updateConfiguration({"newConfigKey":"newConfigValue"}, successCallback, errorCallback);
C#
Syntax
Copied to your clipboardpublic static void UpdateConfiguration(Dictionary<string, object> config);
Example
Copied to your clipboardvar dict = new Dictionary<string, object>();dict.Add("newConfigKey", "newConfigValue");ACPCore.UpdateConfiguration(dict);
C#
Syntax
Copied to your clipboardvoid UpdateConfiguration([NullAllowed] NSDictionary config);
iOS example
Copied to your clipboardvar config = new NSMutableDictionary<NSString, NSObject>{["newConfigKey"] = new NSString("newConfigValue")};ACPCore.UpdateConfiguration(config);
Android example
Copied to your clipboardvar config = new Dictionary<string, Java.Lang.Object>();config.Add("newConfigKey", "newConfigValue");ACPCore.UpdateConfiguration(config);