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 API. It will also clear any updates to the MobilePrivacyStatus(Android)/ PrivacyStatus(iOS) made via setPrivacyStatus.

Here are some scenarios based on the order of calls:

  1. configureWithAppId
  2. updateConfiguration
  3. clearUpdatedConfiguration

Result: You end up with the initial configuration set via configureWithAppId.

  1. configureWithFileInPath
  2. updateConfiguration
  3. clearUpdatedConfiguration

Result: You end up with the initial configuration set via configureWithFileInPath.

  1. configureWithAppId or configureWithFileInPath or configureWithFileInAssets
  2. updateConfiguration
  3. clearUpdatedConfiguration
  4. updateConfiguration

Result: 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.

  1. configureWithAppId or configureWithFileInPath or configureWithFileInAssets
  2. setPrivacyStatus
  3. clearUpdatedConfiguration

Result: In this example, the configuration will have the initial MobilePrivacyStatus(Android)/ PrivacyStatus(iOS) set via configureWithAppId or configureWithFileInPath or configureWithFileInAssets.

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);
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.