Builder

class Builder

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Builds the configuration object.

Link copied to clipboard
fun setAdmMessagingRegistrationEnabled(admMessagingRegistrationEnabled: Boolean): <Error class: unknown class>

Enables automatic registration for Amazon Device Messaging. When manually passing ADM push tokens to Braze, this setting should be disabled.

Link copied to clipboard

Sets the API key. An empty API key will have no effect and will not be present in the built config object.

Link copied to clipboard
fun setAutomaticGeofenceRequestsEnabled(enabled: Boolean): <Error class: unknown class>

Sets whether Braze Geofences are automatically requested by the Braze SDK. This defaults to true.

Link copied to clipboard
fun setBadNetworkDataFlushInterval(badNetworkIntervalSeconds: Int): <Error class: unknown class>

Sets the data flush interval on poor connections. On android.os.Build.VERSION_CODES.N and below, this for example is GPRS and/or EDGE. Otherwise, this is defined as roaming data connections or connections where the max network link upstream/downstream bandwidth is below 4 Mbps.

fun setContentCardsUnreadVisualIndicatorEnabled(contentCardsUnreadVisualIndicatorEnabled: Boolean): <Error class: unknown class>

Sets whether the Content Cards unread visual indication bar is enabled.

Link copied to clipboard
fun setCustomEndpoint(customEndpoint: String): <Error class: unknown class>

Sets a custom API endpoint. When the Braze singleton is initialized, it will point to the specified custom endpoint.

Link copied to clipboard
fun setCustomLocationProviderNames(locationProviderNames: EnumSet<LocationProviderName>): <Error class: unknown class>

The set of custom location provider names. Note that only one provider will ultimately be used to provide a session start location.

Link copied to clipboard
fun setCustomWebViewActivityClass(customWebViewActivityClass: Class<*>): <Error class: unknown class>

Sets the activity that Braze will use when opening a deeplink inside the app via a android.webkit.WebView instead of the default Braze WebView Activity.

Link copied to clipboard
fun setDefaultNotificationAccentColor(defaultNotificationAccentColor: Int): <Error class: unknown class>

This integer sets the default accent color for push notifications. If not specified, the default background color is gray (the same gray Android uses for system notifications). This value can be overridden at runtime by a push notification that sets a custom accent color.

Link copied to clipboard

Sets the android.app.NotificationChannel user facing description as seen via NotificationChannel.getDescription for the Braze default NotificationChannel.

Link copied to clipboard

Sets the android.app.NotificationChannel user facing name as seen via NotificationChannel.getName for the Braze default NotificationChannel.

Link copied to clipboard
fun setDeviceObjectAllowlist(deviceObjectAllowlist: EnumSet<DeviceKey>): <Error class: unknown class>

Device object allowlisting is a feature where the SDK can be configured to only send a subset of the device object keys/values according to some allowlist. An empty allowlist will result in no device data being sent to Braze.

Link copied to clipboard
fun setDeviceObjectAllowlistEnabled(enabled: Boolean): <Error class: unknown class>

Device object allowlisting is a feature where the SDK can be configured to only send a subset of the device object keys/values according to some allowlist.

Link copied to clipboard
fun setDeviceObjectWhitelist(deviceObjectAllowlist: EnumSet<DeviceKey>): <Error class: unknown class>
Link copied to clipboard
fun setDeviceObjectWhitelistEnabled(enabled: Boolean): <Error class: unknown class>
Link copied to clipboard
fun setDoesPushStoryDismissOnClick(enabled: Boolean): <Error class: unknown class>

Sets whether a push story is automatically dismissed when clicked.

fun setFallbackFirebaseMessagingServiceClasspath(classpath: String): <Error class: unknown class>

Sets the classpath for the fallback Firebase Cloud Messaging Service. Note that this class must have a "onMessageReceived(remoteMessage: RemoteMessage)" method to be invoked correctly.

fun setFallbackFirebaseMessagingServiceEnabled(enabled: Boolean): <Error class: unknown class>

Sets whether the use of a fallback Firebase Cloud Messaging Service is enabled. A fallback service will be used whenever a push sent to the default Braze Firebase Messaging Service cannot be handled by Braze.

Link copied to clipboard

Sets the sender ID key used to register for Firebase Cloud Messaging. String cannot be empty

Link copied to clipboard
fun setGeofencesEnabled(enabled: Boolean): <Error class: unknown class>

Sets whether the Braze Geofences feature is enabled. Note that if this field is not set, location collection being enabled/disabled will determine whether Braze Geofences are enabled.

Link copied to clipboard
fun setGoodNetworkDataFlushInterval(goodNetworkIntervalSeconds: Int): <Error class: unknown class>

Sets the data flush interval on good connections. On android.os.Build.VERSION_CODES.N and below, this for example is 3G. Otherwise, this is defined as roaming data connections or connections where the max network link upstream/downstream bandwidth is between 4 Mbps and 14 Mbps.

Link copied to clipboard
fun setGreatNetworkDataFlushInterval(greatNetworkIntervalSeconds: Int): <Error class: unknown class>

Sets the data flush interval on great connections. On android.os.Build.VERSION_CODES.N and below, this for example is 4G or Wifi. Otherwise, this is defined as roaming data connections or connections where the max network link upstream/downstream bandwidth is above 14 Mbps.

Link copied to clipboard
fun setHandlePushDeepLinksAutomatically(handlePushDeepLinksAutomatically: Boolean): <Error class: unknown class>

Enables Braze to automatically open your app and any deep links when a push notification is clicked. See BrazeNotificationUtils.routeUserWithNotificationOpenedIntent() in the UI project for more details.

fun setInAppMessageTestPushEagerDisplayEnabled(enabled: Boolean): <Error class: unknown class>

Gets whether the In-App Message Test Push will attempt to automatically display the test In-App Message without the need for clicking on a push beforehand. If the app is in the background or otherwise can't immediately display the In-App Message, a push will be displayed instead.

Sets the maximum length of time, in milliseconds, to wait for the android.webkit.WebViewClient.onPageFinished callback to fire before displaying an HTML In-App Message.

fun setIsFirebaseCloudMessagingRegistrationEnabled(firebaseMessagingRegistrationEnabled: Boolean): <Error class: unknown class>

Sets whether the SDK to automatically register for Firebase Cloud Messaging. When manually passing push tokens to Braze, this setting should be disabled.

fun setIsFirebaseMessagingServiceOnNewTokenRegistrationEnabled(enabled: Boolean): <Error class: unknown class>

Determines whether the Braze will automatically register tokens in com.google.firebase.messaging.FirebaseMessagingService.onNewToken.

fun setIsHtmlInAppMessageApplyWindowInsetsEnabled(enabled: Boolean): <Error class: unknown class>

Determines whether view window insets are applied automatically for HTML In-App Messages. By default, this is false.

fun setIsHtmlInAppMessageHtmlLinkTargetEnabled(enabled: Boolean): <Error class: unknown class>

Determines whether the link target is supported for HTML In-App Messages.

fun setIsInAppMessageAccessibilityExclusiveModeEnabled(enabled: Boolean): <Error class: unknown class>

In-app message accessibility exclusive mode, when enabled, forces accessibility readers to only be able to read currently displaying in-app messages and no other screen contents. A common use for this feature is the desire to prevent Android TalkBack from reading out UI elements "behind" a currently displaying in-app message.

Link copied to clipboard
fun setIsLocationCollectionEnabled(isLocationCollectionEnabled: Boolean): <Error class: unknown class>

This boolean sets whether Braze should automatically collect location (if the user permits). If set to true, location data will be collected once at the start of each session. If not specified or set to false, all location collection will be disabled and location will never be set for the user unless integrating apps manually call BrazeUser.setLastKnownLocation.

fun setIsPushWakeScreenForNotificationEnabled(enabled: Boolean): <Error class: unknown class>

Sets whether a screen wakelock will be acquired to wake the device screen for push notifications. Note that the android.Manifest.permission#WAKE_LOCK must also be held by the app for the wakelock to be acquired if this is enabled.

Link copied to clipboard
fun setIsSdkAuthenticationEnabled(enabled: Boolean): <Error class: unknown class>

Sets whether SDK authentication is enabled.

Link copied to clipboard
fun setIsSessionStartBasedTimeoutEnabled(isSessionStartBasedTimeoutEnabled: Boolean): <Error class: unknown class>

Sets the session timeout behavior to be either session-start or session-end based. When true, the session timeout and eventual session end is calculated using the timestamp of the start of the session. When false, the session timeout and eventual session end is calculated using the end of the session.

fun setIsTouchModeRequiredForHtmlInAppMessages(required: Boolean): <Error class: unknown class>

Determines whether View.isInTouchMode is required to show HTML In-App Messages. By default, this is true.

Link copied to clipboard
fun setLargeNotificationIcon(largeNotificationIconName: String): <Error class: unknown class>

Sets the large icon used in notifications.

Link copied to clipboard
fun setNewsfeedVisualIndicatorOn(newsfeedVisualIndicatorOn: Boolean): <Error class: unknown class>

When true, sets the Newsfeed visual indicator for read/unread status to be enabled.

Link copied to clipboard
fun setOptInWhenPushAuthorized(enabled: Boolean): <Error class: unknown class>

Sets if Braze should automatically opt-in the user when push is authorized by Android.

Link copied to clipboard
fun setPushDeepLinkBackStackActivityClass(pushDeepLinkActivityClass: Class<*>): <Error class: unknown class>

Sets the activity that Braze will add to the back stack when automatically following deep links for push.

Link copied to clipboard
fun setPushDeepLinkBackStackActivityEnabled(pushDeepLinkBackStackActivityEnabled: Boolean): <Error class: unknown class>

Enables Braze to add an activity to the back stack when automatically following deep links for push. When disabled, no activity is added to the back stack only the deep link is followed.

Link copied to clipboard
fun setPushHtmlRenderingEnabled(enabled: Boolean): <Error class: unknown class>

Sets whether a the text content in push notifications should be interpreted and rendered as Html using android.text.Html.fromHtml.

Link copied to clipboard
fun setSdkFlavor(sdkFlavor: SdkFlavor?): <Error class: unknown class>

Internal method. Do not use.

Link copied to clipboard
fun setSdkMetadata(sdkMetadata: EnumSet<BrazeSdkMetadata>?): <Error class: unknown class>

Configures the SDK Metadata for this integration. Note that fields set here will append any fields set elsewhere on the SDK.

Link copied to clipboard
fun setServerTarget(serverTarget: String): <Error class: unknown class>

Internal method. Do not use.

Link copied to clipboard
fun setSessionTimeout(sessionTimeoutSeconds: Int): <Error class: unknown class>

The length of time before a session times out in seconds. The session manager will "re-open" otherwise closed sessions if the call to StartSession comes within this interval.

fun setShouldAddStatusBarPaddingToInAppMessages(enabled: Boolean): <Error class: unknown class>

Sets whether In-App Messages should be padded at the top by the height of the status bar. This is used in situations where the Braze SDK is unable to properly determine if the status bar is transparent or not. This situation can occur when using a cross-platform framework.

fun setShouldPreventInAppMessageDisplayForDifferentUsers(enabled: Boolean): <Error class: unknown class>

Sets whether In-App Messages should automatically be prevented from displaying when the triggered user-id is different from the current user-id.

Link copied to clipboard
fun setShouldUseWindowFlagSecureInActivities(enabled: Boolean): <Error class: unknown class>

Sets if Braze should set the LayoutParams.FLAG_SECURE flag to secure Braze defined Activities via window flags.

Link copied to clipboard
fun setSmallNotificationIcon(smallNotificationIconName: String): <Error class: unknown class>

Sets the small icon used in notifications.

fun setTriggerActionMinimumTimeIntervalSeconds(triggerActionMinimumTimeIntervalSeconds: Int): <Error class: unknown class>

The minimum interval in seconds between actions, such as an in-app message, that can be triggered by an in-app event, such as the logging of a custom event. This is a general rate limit for actions to prevent overloading a user with messages.

Link copied to clipboard
open override fun toString(): String