Edit in GitHubLog an issue

Configuration API reference

clearUpdatedConfiguration

You can clear any programmatic updates made to the configuration via the clearUpdatedConfiguration API. This will clear programmatic updates to configuration made via the updateConfiguration(configMap)(Android)/ updateConfigurationWith(configDict:)(iOS) API. It will also clear any updates to the MobilePrivacyStatus(Android)/ PrivacyStatus(iOS) made via setPrivacyStatus(privacyStatus)(Android)/ setPrivacyStatus(_ status:)(iOS).

Here are some examples of scenarios:

  • configureWithAppId(appId)(Android)/configureWith(appId:)(iOS) -> updateConfiguration(configMap)(Android)/ updateConfigurationWith(configDict:)(iOS) -> clearUpdatedConfiguration(): In this example, you end up with the initial configuration set via configureWithAppId(appId)(Android)/ configureWith(appId:)(iOS)

  • configureWithFileInPath(filePath)(Android)/ configureWith(filePath:)(iOS) -> updateConfiguration(configMap)(Android)/ updateConfigurationWith(configDict)(iOS) -> clearUpdatedConfiguration(): In this example, you end up with the initial configuration set via configureWithFileInPath(filePath)(Android)/ configureWith(filePath:)(iOS)

  • configureWithFileInAssets(fileName)(Android) -> updateConfiguration(configMap)(Android) -> clearUpdatedConfiguration(): In this example, you end up with the initial configuration set via configureWithFileInAssets(fileName)(Android)

  • configureWithAppId(appId)(Android)/configureWith(appId:)(iOS) or configureWithFileInPath(filePath)(Android)/ configureWith(filePath:)(iOS) or configureWithFileInAssets(fileName)(Android) -> updateConfiguration(configMap)(Android)/ updateConfigurationWith(configDict)(iOS) -> clearUpdatedConfiguration() -> updateConfiguration(configMap)(Android)/ updateConfigurationWith(configDict)(iOS): In this example, the configuration will be the most recently updated configuration and will not have any keys from the first update unless they are included in the most recent update.

  • configureWithAppId(appId)(Android)/configureWith(appId:)(iOS) or configureWithFileInPath(filePath)(Android)/ configureWith(filePath:)(iOS) or configureWithFileInAssets(fileName)(Android) -> setPrivacyStatus(privacyStatus)(Android)/ setPrivacyStatus(_ status:)(iOS) -> clearUpdatedConfiguration(): In this example, the configuration will have the initial MobilePrivacyStatus(Android)/ PrivacyStatus(iOS) set via configureWithAppId(appId)(Android)/configureWith(appId:)(iOS) or configureWithFileInPath(filePath)(Android)/ configureWith(filePath:)(iOS) or configureWithFileInAssets(fileName)(Android).

Java

Syntax

Copied to your clipboard
public static void clearUpdatedConfiguration();

Example

Copied to your clipboard
MobileCore.clearUpdatedConfiguration();

configureWithAppID

This API causes the SDK to download the configuration for the provided app ID and apply the configuration to the current session.

Java

Syntax

Copied to your clipboard
public static void configureWithAppID(@NonNull final String appId);

Example

Copied to your clipboard
MobileCore.configureWithAppId("1423ae38-8385-8963-8693-28375403491d");

configureWithFileInAssets

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.

Java

Syntax

Copied to your clipboard
public static void configureWithFileInAssets(@NonNull final String fileName);

Example

Copied to your clipboard
MobileCore.configureWithFileInAssets("exampleJSONfile.json");

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:

Java

Syntax

Copied to your clipboard
public static void configureWithFileInPath(@NonNull final String filePath);

Example

Copied to your clipboard
MobileCore.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:

Java

Copied to your clipboard
String coreExtensionVersion = MobileCore.extensionVersion();

updateConfiguration

You can also update the configuration programmatically by passing configuration keys and values to override the existing configuration.

Java

Syntax

Copied to your clipboard
public static void updateConfiguration(@NonNull final Map configMap);

Example

Copied to your clipboard
HashMap<String, Object> data = new HashMap<String, Object>();
data.put("global.privacy", "optedout");
MobileCore.updateConfiguration(data);
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.