Adding the mandatory configuration to Oracle CX Core SDK Module

Once you have integrated Oracle CX Core SDK as module, its required to pass mandatory configurations such as URL and account_guid etc. This can be done in either in Application class or any other activity/fragment. To setup the basic configurations like URL & account_guid we need to use ORABaseConfigSettings.ORAEndPointConfig. This configuration will help sending data to Infinity Data Collection server. Below is the sample code using ORACoreDataContainer.

ORABaseConfigSettings.ORAEndPointConfig key expects an JSON array which should contain JSON objects with three entries. They are Endpoint URL, account GUID and Retry count. Multiple JSON objects represents multiple endpoints to send payload. You can learn more about configurations in Configuration Guide page.

  1. Extend ORABaseApplication in your Application class.
  2. In the onCreate() method of application class, create instance of the ORACoreDataContainer with context.
  3. Create object for Map<ORACoreDataContainer, String> map and put configurations in it. Then finally call loadConfig method by passing the map.

Example code for loadConfig method by passing with multiple configurations map is below.

@Override
publicvoid onCreate() {
super.onCreate();
ORACoreDataContainer container = new ORACoreDataContainer(this);
Map<ORABaseConfigSettings, String> map = new HashMap<>();
map.put(ORABaseConfigSettings.END_POINT_CONFIG, "[{" +
"\"ora_dc_collection_url\": \"https://dc.oracleinfinity.io/v3/\"," +
"\"ora_dc_account_guid\": \"<account_guid>\"," +
"\"ora_dc_retry_count\":\"2\"" +
"}]"
);
try {
container.loadConfig(map, 1);
} catch (ORAModuleIDException e) {
e.printStackTrace();
}
}

Its not mandatory to set end point config in Application class. It can be done in any other android component which can provide Context. The configuration entry which mandatory is ORABaseConfigSettings.END_POINT_CONFIG. Remaining all are optional.

Your project is now configured to use The Oracle CX Core SDK.