Additional Customization and Configuration

Using R8/Proguard with Braze

Code shrinking configuration is automatically included with your Braze integration.

Client apps that obfuscate Braze code must store release mapping files for Braze to interpret stack traces. If you would like to continue to keep all Braze code, add the following to your Proguard file:

1
2
-keep class bo.app.** { *; }
-keep class com.appboy.** { *; }

Enabling Verbose Logging

Verbose logs from the Braze SDK are essential to a fast turnaround on support issues. These logs should not be modified for clarity; long log files are preferred! Verbose logging is only intended to be used in development environments and should not be enabled in a released application. Logs sent to our support team should begin as soon as the application is launched and should end well after the observed issue occurs.

To enable verbose logging on the Braze Android SDK:

1
BrazeLogger.setLogLevel(Log.VERBOSE);
1
BrazeLogger.setLogLevel(Log.VERBOSE)

To know if your obtained logs are verbose, look for V/Braze somewhere in your logs. For example:

2077-11-19 16:22:49.591 ? V/Braze v9.0.01 .bo.app.d3: Request started

Suppressing Braze SDK Logging

The default Log Level for the Braze Android SDK is INFO.

To change the Braze Log Level, call BrazeLogger.setLogLevel() with one of the android.util.Log constants or BrazeLogger.SUPPRESS. For example:

1
2
// Suppress all logs
BrazeLogger.setLogLevel(BrazeLogger.SUPPRESS);
1
2
// Suppress all logs
BrazeLogger.setLogLevel(BrazeLogger.SUPPRESS)

Multiple API Keys

The most common use case for multiple API keys is separating API keys for debug and release build variants.

To easily switch between multiple API keys in your builds, we recommend creating a separate braze.xml file for each relevant build variant. A build variant is a combination of build type and product flavor. Note that by default, a new Android project is configured with debug and release build types and no product flavors.

For each relevant build variant, create a new braze.xml for it in src/<build variant name>/res/values/:

1
2
3
4
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="com_appboy_api_key">REPLACE_WITH_YOUR_BUILD_VARIANT_API_KEY</string>
</resources>

When the build variant is compiled, it will use the new API key.

To set an API key in code, please see the runtime configuration documentation.

WAS THIS PAGE HELPFUL?
New Stuff!