public static class BrazeConfig.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
BrazeConfig |
build()
Builds the configuration object.
|
BrazeConfig.Builder |
setAdmMessagingRegistrationEnabled(boolean admMessagingRegistrationEnabled)
Enables automatic registration for Amazon Device Messaging.
|
BrazeConfig.Builder |
setApiKey(java.lang.String apiKey)
Sets the API key.
|
BrazeConfig.Builder |
setAutomaticGeofenceRequestsEnabled(boolean enabled)
Sets whether Braze Geofences are automatically requested
by the Braze SDK.
|
BrazeConfig.Builder |
setBadNetworkDataFlushInterval(int badNetworkIntervalSeconds)
Sets the data flush interval on poor connections.
|
BrazeConfig.Builder |
setContentCardsUnreadVisualIndicatorEnabled(boolean contentCardsUnreadVisualIndicatorEnabled)
Sets whether the Content Cards unread visual indication bar is enabled.
|
BrazeConfig.Builder |
setCustomEndpoint(java.lang.String customEndpoint)
Sets a custom API endpoint.
|
BrazeConfig.Builder |
setCustomLocationProviderNames(java.util.EnumSet<LocationProviderName> locationProviderNames)
The set of custom location provider names.
|
BrazeConfig.Builder |
setCustomWebViewActivityClass(java.lang.Class<?> customWebViewActivityClass)
Sets the activity that Braze will use when opening a deeplink inside the app via a
WebView instead of the default Braze WebView Activity. |
BrazeConfig.Builder |
setDefaultNotificationAccentColor(int defaultNotificationAccentColor)
This integer sets the default accent color for push notifications on Android Lollipop and higher.
|
BrazeConfig.Builder |
setDefaultNotificationChannelDescription(java.lang.String description)
Sets the
NotificationChannel user facing description as seen via NotificationChannel.getDescription() for the Braze default NotificationChannel. |
BrazeConfig.Builder |
setDefaultNotificationChannelName(java.lang.String name)
Sets the
NotificationChannel user facing name as seen via NotificationChannel.getName() for the Braze default NotificationChannel. |
BrazeConfig.Builder |
setDeviceObjectAllowlist(java.util.EnumSet<DeviceKey> deviceObjectAllowlist)
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.
|
BrazeConfig.Builder |
setDeviceObjectAllowlistEnabled(boolean enabled)
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.
|
BrazeConfig.Builder |
setDeviceObjectWhitelist(java.util.EnumSet<DeviceKey> deviceObjectAllowlist)
Deprecated.
|
BrazeConfig.Builder |
setDeviceObjectWhitelistEnabled(boolean enabled)
Deprecated.
|
BrazeConfig.Builder |
setFirebaseCloudMessagingSenderIdKey(java.lang.String firebaseSenderId)
Sets the sender ID key used to register for Firebase Cloud Messaging.
|
BrazeConfig.Builder |
setGeofencesEnabled(boolean enabled)
Gets whether the Braze Geofences feature is enabled.
|
BrazeConfig.Builder |
setGoodNetworkDataFlushInterval(int goodNetworkIntervalSeconds)
Sets the data flush interval on good connections.
|
BrazeConfig.Builder |
setGreatNetworkDataFlushInterval(int greatNetworkIntervalSeconds)
Sets the data flush interval on great connections.
|
BrazeConfig.Builder |
setHandlePushDeepLinksAutomatically(boolean handlePushDeepLinksAutomatically)
Enables Braze to automatically open your app and any deep links when a push notification is clicked.
|
BrazeConfig.Builder |
setInAppMessageTestPushEagerDisplayEnabled(boolean enabled)
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.
|
BrazeConfig.Builder |
setInAppMessageWebViewClientMaxOnPageFinishedWaitMs(int maxOnPageFinishedWaitMs)
Sets the maximum length of time, in milliseconds,
to wait for the
WebViewClient.onPageFinished(WebView, String)
callback to fire before displaying an HTML In-App Message. |
BrazeConfig.Builder |
setIsFirebaseCloudMessagingRegistrationEnabled(boolean firebaseMessagingRegistrationEnabled)
Sets whether the SDK to automatically register for Firebase Cloud Messaging.
|
BrazeConfig.Builder |
setIsFirebaseMessagingServiceOnNewTokenRegistrationEnabled(boolean enabled)
Determines whether the Braze will automatically register tokens in
com.google.firebase.messaging.FirebaseMessagingService#onNewToken(String). |
BrazeConfig.Builder |
setIsInAppMessageAccessibilityExclusiveModeEnabled(boolean enabled)
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.
|
BrazeConfig.Builder |
setIsLocationCollectionEnabled(boolean isLocationCollectionEnabled)
This boolean sets whether Braze should automatically collect location (if the user permits).
|
BrazeConfig.Builder |
setIsPushWakeScreenForNotificationEnabled(boolean enabled)
Sets whether a screen wakelock will be acquired to wake the device screen for
push notifications.
|
BrazeConfig.Builder |
setIsSdkAuthenticationEnabled(boolean enabled)
Sets whether SDK authentication is enabled.
|
BrazeConfig.Builder |
setIsSessionStartBasedTimeoutEnabled(boolean isSessionStartBasedTimeoutEnabled)
Sets the session timeout behavior to be either session-start or session-end based.
|
BrazeConfig.Builder |
setIsTouchModeRequiredForHtmlInAppMessages(boolean required)
Determines whether
View.isInTouchMode() is required
to show HTML In-App Messages. |
BrazeConfig.Builder |
setLargeNotificationIcon(java.lang.String largeNotificationIconName)
Sets the large icon used in notifications.
|
BrazeConfig.Builder |
setLocaleToApiMapping(java.util.List<java.lang.String> localeToApiMapping)
Sets the locale to API key mapping as a list of strings.
|
BrazeConfig.Builder |
setNewsfeedVisualIndicatorOn(boolean newsfeedVisualIndicatorOn)
When true, sets the Newsfeed visual indicator for read/unread status to be enabled.
|
BrazeConfig.Builder |
setPushDeepLinkBackStackActivityClass(java.lang.Class<?> pushDeepLinkActivityClass)
Sets the activity that Braze will add to the back stack when automatically following deep links for push.
|
BrazeConfig.Builder |
setPushDeepLinkBackStackActivityEnabled(boolean pushDeepLinkBackStackActivityEnabled)
Enables Braze to add an activity to the back stack when automatically following deep links for push.
|
BrazeConfig.Builder |
setPushHtmlRenderingEnabled(boolean enabled)
Sets whether a the text content in push notifications should be interpreted and
rendered as Html using
Html.fromHtml(String, int). |
BrazeConfig.Builder |
setSdkFlavor(SdkFlavor sdkFlavor)
Internal method.
|
BrazeConfig.Builder |
setServerTarget(java.lang.String serverTarget)
Internal method.
|
BrazeConfig.Builder |
setSessionTimeout(int sessionTimeoutSeconds)
The length of time before a session times out in seconds.
|
BrazeConfig.Builder |
setSmallNotificationIcon(java.lang.String smallNotificationIconName)
Sets the small icon used in notifications.
|
BrazeConfig.Builder |
setTriggerActionMinimumTimeIntervalSeconds(int triggerActionMinimumTimeIntervalSeconds)
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.
|
public BrazeConfig build()
public BrazeConfig.Builder setApiKey(java.lang.String apiKey)
apiKey - the API keypublic BrazeConfig.Builder setDefaultNotificationChannelName(java.lang.String name)
NotificationChannel user facing name as seen via NotificationChannel.getName() for the Braze default NotificationChannel.name - the name of the NotificationChannel. May not be null or blank.public BrazeConfig.Builder setDefaultNotificationChannelDescription(java.lang.String description)
NotificationChannel user facing description as seen via NotificationChannel.getDescription() for the Braze default NotificationChannel.description - the description of the NotificationChannel. May not be null or blank.public BrazeConfig.Builder setLocaleToApiMapping(java.util.List<java.lang.String> localeToApiMapping)
localeToApiMapping - the list of Locale to API key mappings. Must not be empty.public BrazeConfig.Builder setServerTarget(java.lang.String serverTarget)
public BrazeConfig.Builder setSdkFlavor(SdkFlavor sdkFlavor)
public BrazeConfig.Builder setNewsfeedVisualIndicatorOn(boolean newsfeedVisualIndicatorOn)
newsfeedVisualIndicatorOn - flag for the read/unread indicator for Newsfeed cards.public BrazeConfig.Builder setSmallNotificationIcon(java.lang.String smallNotificationIconName)
smallNotificationIconName - the name of the notification drawable.public BrazeConfig.Builder setLargeNotificationIcon(java.lang.String largeNotificationIconName)
largeNotificationIconName - the name of the notification drawable.public BrazeConfig.Builder setCustomEndpoint(java.lang.String customEndpoint)
IAppboyEndpointProvider is subsequently set on the
Braze singleton using Appboy.setAppboyEndpointProvider(com.appboy.IAppboyEndpointProvider),
the endpoint set here will be overridden.
customEndpoint - the custom endpoint.public BrazeConfig.Builder setSessionTimeout(int sessionTimeoutSeconds)
sessionTimeoutSeconds - the session timeout in secondspublic BrazeConfig.Builder setDefaultNotificationAccentColor(int defaultNotificationAccentColor)
defaultNotificationAccentColor - the integer color value for the default notification accents.public BrazeConfig.Builder setTriggerActionMinimumTimeIntervalSeconds(int triggerActionMinimumTimeIntervalSeconds)
triggerActionMinimumTimeIntervalSeconds - the minimum number of seconds between triggered actions.public BrazeConfig.Builder setAdmMessagingRegistrationEnabled(boolean admMessagingRegistrationEnabled)
admMessagingRegistrationEnabled - when true, enables automatic registration for ADM Pushpublic BrazeConfig.Builder setHandlePushDeepLinksAutomatically(boolean handlePushDeepLinksAutomatically)
handlePushDeepLinksAutomatically - when true, opens deep links automaticallypublic BrazeConfig.Builder setPushDeepLinkBackStackActivityEnabled(boolean pushDeepLinkBackStackActivityEnabled)
pushDeepLinkBackStackActivityEnabled - when true, an activity is added to the back stack when automatically following push deep links.setHandlePushDeepLinksAutomatically(boolean)public BrazeConfig.Builder setPushDeepLinkBackStackActivityClass(java.lang.Class<?> pushDeepLinkActivityClass)
pushDeepLinkActivityClass - when present, this class is used as the back stack activity when following push deep links.setHandlePushDeepLinksAutomatically(boolean),
setPushDeepLinkBackStackActivityEnabled(boolean)public BrazeConfig.Builder setIsLocationCollectionEnabled(boolean isLocationCollectionEnabled)
BrazeUser.setLastKnownLocation(double, double, Double, Double).
isLocationCollectionEnabled - flag for enabling automatic location collectionpublic BrazeConfig.Builder setBadNetworkDataFlushInterval(int badNetworkIntervalSeconds)
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.
IAppboy.requestImmediateDataFlush() to manually flush analytics data to the server. Note, however, that any
refreshes of the news feed, or in-app message will automatically flush your analytics data as well.badNetworkIntervalSeconds - the data flush interval in secondspublic BrazeConfig.Builder setGoodNetworkDataFlushInterval(int goodNetworkIntervalSeconds)
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.
IAppboy.requestImmediateDataFlush() to manually flush analytics data to the server. Note, however, that any
refreshes of the news feed, or in-app message will automatically flush your analytics data as well.goodNetworkIntervalSeconds - the data flush interval in secondspublic BrazeConfig.Builder setGreatNetworkDataFlushInterval(int greatNetworkIntervalSeconds)
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.
IAppboy.requestImmediateDataFlush() to manually flush analytics data to the server. Note, however, that any
refreshes of the news feed, or in-app message will automatically flush your analytics data as well.greatNetworkIntervalSeconds - the data flush interval in secondspublic BrazeConfig.Builder setIsSessionStartBasedTimeoutEnabled(boolean isSessionStartBasedTimeoutEnabled)
isSessionStartBasedTimeoutEnabled - Whether the session start timeout behavior is enabledpublic BrazeConfig.Builder setIsFirebaseCloudMessagingRegistrationEnabled(boolean firebaseMessagingRegistrationEnabled)
public BrazeConfig.Builder setFirebaseCloudMessagingSenderIdKey(java.lang.String firebaseSenderId)
public BrazeConfig.Builder setContentCardsUnreadVisualIndicatorEnabled(boolean contentCardsUnreadVisualIndicatorEnabled)
@Deprecated public BrazeConfig.Builder setDeviceObjectWhitelist(java.util.EnumSet<DeviceKey> deviceObjectAllowlist)
setDeviceObjectAllowlist(EnumSet)public BrazeConfig.Builder setDeviceObjectAllowlist(java.util.EnumSet<DeviceKey> deviceObjectAllowlist)
setDeviceObjectAllowlistEnabled(boolean)
and no DeviceKeys are set in this method, then no fields will be sent in the device object.deviceObjectAllowlist - An EnumSet of the allowlisted device object keys.for all valid device object keys.,
setDeviceObjectAllowlistEnabled(boolean)@Deprecated public BrazeConfig.Builder setDeviceObjectWhitelistEnabled(boolean enabled)
setDeviceObjectAllowlistEnabled(boolean)public BrazeConfig.Builder setDeviceObjectAllowlistEnabled(boolean enabled)
public BrazeConfig.Builder setIsInAppMessageAccessibilityExclusiveModeEnabled(boolean enabled)
public BrazeConfig.Builder setIsPushWakeScreenForNotificationEnabled(boolean enabled)
public BrazeConfig.Builder setPushHtmlRenderingEnabled(boolean enabled)
Html.fromHtml(String, int).
By default, this is disabled.
public BrazeConfig.Builder setGeofencesEnabled(boolean enabled)
public BrazeConfig.Builder setInAppMessageTestPushEagerDisplayEnabled(boolean enabled)
public BrazeConfig.Builder setCustomWebViewActivityClass(java.lang.Class<?> customWebViewActivityClass)
WebView instead of the default Braze WebView Activity.
Intent.getExtras() with the key Constants.APPBOY_WEBVIEW_URL_EXTRA.
public BrazeConfig.Builder setAutomaticGeofenceRequestsEnabled(boolean enabled)
public BrazeConfig.Builder setCustomLocationProviderNames(java.util.EnumSet<LocationProviderName> locationProviderNames)
LocationProviderNamepublic BrazeConfig.Builder setInAppMessageWebViewClientMaxOnPageFinishedWaitMs(int maxOnPageFinishedWaitMs)
WebViewClient.onPageFinished(WebView, String)
callback to fire before displaying an HTML In-App Message.
Defaults to 15 seconds.
maxOnPageFinishedWaitMs - A non-negative length of time to wait for
the WebViewClient.onPageFinished(WebView, String)
callback to fire.public BrazeConfig.Builder setIsFirebaseMessagingServiceOnNewTokenRegistrationEnabled(boolean enabled)
com.google.firebase.messaging.FirebaseMessagingService#onNewToken(String).public BrazeConfig.Builder setIsSdkAuthenticationEnabled(boolean enabled)
public BrazeConfig.Builder setIsTouchModeRequiredForHtmlInAppMessages(boolean required)
View.isInTouchMode() is required
to show HTML In-App Messages. By default, this is true.