Other Apache Cordova APIs

Adjust the log level

You can control the amount of log messages that show up from App Center in the console. To do this, open the project's config.xml file; for each of your Apache Cordova project's target platform elements (only Android and iOS today), add a child preference element in the following format:

<preference name="LOG_LEVEL" value="2" />

Set the value to one of the constants, described well in the official Android documentation. Same contants can be used for iOS.

To have as many log messages as possible, use VERBOSE (2) level.

Identify installations

The App Center SDK creates a UUID for each device once the app is installed. This identifier remains the same for a device when the app is updated and a new one is generated only when the app is re-installed or the user manually deletes all app data. The following API is useful for debugging purposes.

var success = function(installId) {
    console.log("Install ID: " + installId);
}

var error = function(error) {
    console.error(error);
}
AppCenter.getInstallId(success, error);

Identify users

The App Center SDK supports setting a user ID that is used to augment crash reports. To use this capability:

  1. Configure the App Center SDK as described in the App Center SDK Getting started guide.
  2. Set a userID in the SDK using the following code:
AppCenter.setUserId("your-user-id");

After setting a user ID, you can use App Center's search feature to search for specific crash reports associated with the ID. Learn more in App Center's search documentation.

Note

The value for the user id is limited to 256 characters.