Additional Customization and Configuration
Using Proguard with Braze
Proguard configuration is automatically included with your Braze integration.
Braze Android SDK v.1.14.0 removes keep
rules from consumerProguardFiles
automatic Proguard configuration. Client apps that Proguard 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 configuration:
1
2
-keep class bo.app.** { *; }
-keep class com.appboy.** { *; }
If you are integrating Baidu Cloud Push with Braze, add:
1
2
-dontwarn com.baidu.**
-keep class com.baidu.** { *; }
Braze Log Level
The default Log Level for the Braze Android SDK is INFO
. This level includes push payload logs and basic Braze server communication logs.
To change the Braze Log Level, call AppboyLogger.setLogLevel()
with one of the android.util.Log
priority constants or AppboyLogger.SUPPRESS
. For example:
1
2
3
4
5
// Change log level to VERBOSE
AppboyLogger.setLogLevel(Log.VERBOSE);
// Suppress logs
AppboyLogger.setLogLevel(AppboyLogger.SUPPRESS);
1
2
3
4
5
// Change log level to VERBOSE
AppboyLogger.setLogLevel(Log.VERBOSE)
// Suppress logs
AppboyLogger.setLogLevel(AppboyLogger.SUPPRESS)
Verbose Logging
When debugging Braze behavior, set the Log level to Verbose
before your first call to Braze, preferably in your Application.onCreate()
. This Log level contains every log made by the Braze SDK. This is only intended to be used in development environments and should not be set in a released application.
If the Braze API Key from the “App Settings” page is not present in
appboy.xml
then an error message is logged to the Android logcat.
If required permissions
ACCESS_NETWORK_STATE
andINTERNET
are not declared in the manifest, an error message is logged to the Android logcat.
Multiple API Keys
The most common usecase 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 appboy.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 appboy.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.