Companion

object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A sentinel value denoting that the runtime configuration's cache should be cleared.

Link copied to clipboard

A custom IBrazeNotificationFactory to be used to modify or create Braze push notifications.

Link copied to clipboard
internal var delayedInitializationProvider: DelayedInitializationProvider?
Link copied to clipboard
internal var deviceDataProvider: IDeviceDataProvider?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private var instance: Braze?
Link copied to clipboard

Returns whether delayed initialization is enabled when either:

Link copied to clipboard

Returns whether the SDK is disabled when either:

Link copied to clipboard

Returns whether the SDK is disabled or delayed initialization is enabled.

Link copied to clipboard

A list of device models matching known app crawlers. All device models must be in lowercase.

Link copied to clipboard
Link copied to clipboard

Pauses or resumes outbound network requests from the Braze SDK at any point during runtime. Events are not lost during the offline state. Manual requests made from the Braze singleton will also be offline. Single shot requests in offline mode, (such as templating, image, and file requests) are lost and will not be repeated later. Basically, everything that is not an event logged to a session will be lost.

Link copied to clipboard

A queued list of BrazeConfig objects made to ".configure()" that will be applied once the singleton is instantiated.

Link copied to clipboard
internal var sdkEnablementProvider: SdkEnablementProvider?
Link copied to clipboard
internal var staticExternalIEventMessenger: IEventMessenger?

An IEventMessenger to store client external subscriptions and survive calls to wipeData.

Functions

Link copied to clipboard
Link copied to clipboard
private fun clearDataStoreData(context: Context)
Link copied to clipboard
Link copied to clipboard
@VisibleForTesting(otherwise = 5)
internal fun clearInstance()
Link copied to clipboard
private fun clearSharedPreferencesData(context: Context)
Link copied to clipboard
fun configure(context: Context, config: BrazeConfig?): Boolean

Optional static method to set configuration values for the Braze singleton, overriding whatever values are present in the braze.xml. Calling this method at the beginning of each app run is encouraged.

Link copied to clipboard

Disables delayed initialization after an invocation of Braze.enableDelayedInitialization or after setting com_braze_enable_delayed_initialization to true in braze.xml. Note that this feature is disabled by default.

Link copied to clipboard

Disables the Braze SDK. This call persists across Braze SDK instances until Braze.enableSdk is called.

Link copied to clipboard
fun enableDelayedInitialization(context: Context, analyticsBehavior: DelayedInitializationAnalyticsBehavior = DelayedInitializationAnalyticsBehavior.QUEUE)

Enables delayed initialization. This call persists across Braze SDK instances until Braze.disableDelayedInitialization is called.

Testing utility method that enables mocking for all Braze SDK network requests, essentially turning the SDK "off".

Link copied to clipboard

Enables the Braze SDK after an invocation of Braze.disableSdk. Note that the Braze SDK is enabled by default.

Link copied to clipboard
fun getApiEndpoint(brazeEndpoint: Uri): Uri

If an IBrazeEndpointProvider is configured, that provider's delegate is used to generate the Uri for the Braze API endpoint. Otherwise, return the Uri given.

Link copied to clipboard

A helper method to determine if the SDK is configured with an API key. Note that the SDK should not be called without a configured API key under any circumstances.

Link copied to clipboard
internal fun getDelayedInitializationProvider(context: Context): DelayedInitializationProvider
Link copied to clipboard

Static method that returns the latest Braze instance. All requests to Braze are made through this instance. There are no guarantees that previous instances will be the same so do not cache returned instances.

Link copied to clipboard
private fun getSdkEnablementProvider(context: Context): SdkEnablementProvider
Link copied to clipboard
internal fun requestTriggersIfInAppMessageTestPush(intent: Intent, brazeManager: IBrazeManager)

Requests triggers on the BrazeManager object if the Intent represents a test in-app message push.

Link copied to clipboard
internal fun setConfiguredCustomEndpoint(configuredCustomEndpoint: String?)

Creates an IBrazeEndpointProvider for any endpoint configured via braze.xml or BrazeConfig.

Link copied to clipboard

Sets an IBrazeEndpointProvider to be used to route Braze API traffic

Link copied to clipboard
Link copied to clipboard
internal fun stopInstance(clearStorage: Boolean)

Stops the instance by shutting down or cancelling any work on the SDK. Note that this renders the current instance SDK unusable.

Link copied to clipboard
fun wipeData(context: Context)

Hard resets all data created by the Braze SDK from the internal storage directory. Note that any in-flight actions such as event logging, data syncing, etc. will be cancelled as a result of this call.