Runtime configuration
Runtime configuration is an optional way to configure your app at runtime in place of a
braze.xml
. This reference article covers how to set up runtime configuration.
The use of both runtime configuration and braze.xml
configuration is still possible. Runtime configured values will always take precedence over the same value in the braze.xml
. If the Braze SDK can find all values in the runtime configuration, then the braze.xml
is no longer needed and can be removed.
Example usage
The configuration uses a builder object that is then built and passed to Braze.configure()
. The following example uses a subset of the runtime configuration options available, see our KDoc for a complete list of options.
1
2
3
4
5
6
7
8
BrazeConfig brazeConfig = new BrazeConfig.Builder()
.setApiKey("api-key-here")
.setCustomEndpoint("YOUR_CUSTOM_ENDPOINT_OR_CLUSTER")
.setSessionTimeout(60)
.setHandlePushDeepLinksAutomatically(true)
.setGreatNetworkDataFlushInterval(10)
.build();
Braze.configure(this, brazeConfig);
1
2
3
4
5
6
7
8
val brazeConfig = BrazeConfig.Builder()
.setApiKey("api-key-here")
.setCustomEndpoint("YOUR_CUSTOM_ENDPOINT_OR_CLUSTER")
.setSessionTimeout(60)
.setHandlePushDeepLinksAutomatically(true)
.setGreatNetworkDataFlushInterval(10)
.build()
Braze.configure(this, brazeConfig)
Another example can be found in our Hello Braze sample app.
New Stuff!