JavascriptInterfaceBase

abstract class JavascriptInterfaceBase(context: Context)

Base class for JavaScript bridge interfaces exposed to Braze WebViews. Provides common SDK operations (user changes, event logging, purchases, data flushing) that can be invoked from HTML/JavaScript content.

Parameters

context

The Android Context for Braze SDK access.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard
fun changeUser(userId: String, sdkAuthSignature: String?)

Changes the current Braze user.

Link copied to clipboard
abstract fun logButtonClick(buttonId: String?)

Logs a button click for the given button identifier.

Link copied to clipboard
abstract fun logClick()

Logs a click on the message associated with this JavaScript interface.

Link copied to clipboard
fun logCustomEventWithJSON(eventName: String?, propertiesJSON: String?)

Logs a custom event with optional JSON-encoded properties.

Link copied to clipboard
fun logPurchaseWithJSON(productId: String?, price: String, currencyCode: String?, quantity: String, propertiesJSON: String?)

Logs a purchase event with the specified product, price, currency, quantity, and optional JSON-encoded properties.

Link copied to clipboard
fun parseProperties(propertiesJSON: String?): BrazeProperties?
Link copied to clipboard

Requests an immediate flush of any pending analytics data to the Braze servers.