BrazePlugin class

Constructors

BrazePlugin({dynamic inAppMessageHandler(BrazeInAppMessage)?, dynamic brazeSdkAuthenticationErrorHandler(BrazeSdkAuthenticationError)?, dynamic contentCardsHandler(List<BrazeContentCard>)?, dynamic featureFlagsHandler(List<BrazeFeatureFlag>)?, dynamic pushEventHandler(BrazePushEvent)?, Map<String, bool>? customConfigs})
The plugin used to interface with all Braze APIs with optional parameters specific customization.

Properties

contentCardsStreamController StreamController<List<BrazeContentCard>>
Broadcast stream to listen for content cards.
getter/setter pair
featureFlagsStreamController StreamController<List<BrazeFeatureFlag>>
Broadcast stream to listen for feature flags.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inAppMessageStreamController StreamController<BrazeInAppMessage>
Broadcast stream to listen for in-app messages.
getter/setter pair
pushEventStreamController StreamController<BrazePushEvent>
Broadcast stream to listen for push notification events.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAlias(String aliasName, String aliasLabel) → void
Add alias for current user.
addToCustomAttributeArray(String key, String value) → void
Adds an element to a custom attribute array.
addToSubscriptionGroup(String groupId) → void
Adds the user to a Subscription Group using the group's UUID provided in the Braze dashboard.
changeUser(String userId, {String? sdkAuthSignature}) → void
Changes the current Braze userId. If sdkAuthSignature is present, passes that token to the native layer.
disableSDK() → void
Disables the SDK. Please consult iOS and Android-specific implementation details before using.
enableSDK() → void
Enables the SDK. Please consult iOS and Android-specific implementation details before using.
getAllFeatureFlags() Future<List<BrazeFeatureFlag>>
Get all Feature Flags from current cache.
getCachedContentCards() Future<List<BrazeContentCard>>
Get all Content Cards from current cache.
getDeviceId() Future<String>
Gets the device id.
getFeatureFlagByID(String id) Future<BrazeFeatureFlag?>
Get a single Feature Flag. Returns null if there is no feature flag with that ID.
getInstallTrackingId() Future<String>
Gets the install tracking id.
incrementCustomUserAttribute(String key, int value) → void
Increments an integer typed custom attribute.
launchContentCards() → void
Launches Content Card Feed.
logContentCardClicked(BrazeContentCard contentCard) → void
Logs a click for the provided Content Card data.
logContentCardDismissed(BrazeContentCard contentCard) → void
Logs dismissal for the provided Content Card data.
logContentCardImpression(BrazeContentCard contentCard) → void
Logs an impression for the provided Content Card data.
logCustomEvent(String eventName, {Map<String, dynamic>? properties}) → void
Logs a custom event to Braze.
logCustomEventWithProperties(String eventName, Map<String, dynamic> properties) → void
Logs a custom event to Braze.
logFeatureFlagImpression(String id) → void
Log an impression for the Feature Flag with the provided id.
logInAppMessageButtonClicked(BrazeInAppMessage inAppMessage, int buttonId) → void
Logs a button click for the provided in-app message button data.
logInAppMessageClicked(BrazeInAppMessage inAppMessage) → void
Logs a click for the provided in-app message data.
logInAppMessageImpression(BrazeInAppMessage inAppMessage) → void
Logs an impression for the provided in-app message data.
logPurchase(String productId, String currencyCode, double price, int quantity, {Map<String, dynamic>? properties}) → void
Logs a purchase event to Braze.
logPurchaseWithProperties(String productId, String currencyCode, double price, int quantity, Map<String, dynamic> properties) → void
Logs a purchase event to Braze.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshFeatureFlags() → void
Request a refresh of the feature flags. This may not always occur if called too soon.
registerAndroidPushToken(String pushToken) → void
Registers a push token for the current Android device with Braze.
registerPushToken(String pushToken) → void
Registers a push token for the current device with Braze.
removeFromCustomAttributeArray(String key, String value) → void
Removes an element from a custom attribute array.
removeFromSubscriptionGroup(String groupId) → void
Removes the user from a Subscription Group using the group's UUID provided in the Braze dashboard.
requestContentCardsRefresh() → void
Refreshes Content Cards.
requestImmediateDataFlush() → void
Requests an immediate data flush.
requestLocationInitialization() → void
Requests location initialization.
setAdTrackingEnabled(bool adTrackingEnabled, String? googleAdvertisingId) → void
Sets ad tracking configuration for the current user.
setAttributionData(String? network, String? campaign, String? adGroup, String? creative) → void
Sets attribution data.
setBoolCustomUserAttribute(String key, bool value) → void
Sets a boolean typed custom attribute.
setBrazeSdkAuthenticationErrorCallback(dynamic callback(BrazeSdkAuthenticationError)) → void
Sets a callback to receive in-app message data from Braze.
setCountry(String country) → void
Sets the country default user attribute.
setCustomUserAttributeArrayOfObjects(String key, List<Map<String, dynamic>> value) → void
Sets a string typed custom attribute.
setCustomUserAttributeArrayOfStrings(String key, List<String> value) → void
setDateCustomUserAttribute(String key, DateTime value) → void
Sets a date custom attribute.
setDateOfBirth(int year, int month, int day) → void
Sets the dob default user attribute.
setDoubleCustomUserAttribute(String key, double value) → void
Sets a double typed custom attribute.
setEmail(String? email) → void
Sets the email default user attribute. Pass in null to unset the user's email.
setEmailNotificationSubscriptionType(SubscriptionType type) → void
Sets email subscription state for the current user.
setFirstName(String firstName) → void
Sets the first name default user attribute.
setGender(String gender) → void
Sets the gender default user attribute.
setGoogleAdvertisingId(String id, bool adTrackingEnabled) → void
Sets Google Advertising Id for the current user.
setHomeCity(String homeCity) → void
Sets the home city default user attribute.
setIntCustomUserAttribute(String key, int value) → void
Sets a integer typed custom attribute.
setLanguage(String language) → void
Sets the language default user attribute.
setLastKnownLocation({required double latitude, required double longitude, double? altitude, double? accuracy, double? verticalAccuracy}) → void
Sets the last known location.
setLastName(String lastName) → void
Sets the last name default user attribute.
setLocationCustomAttribute(String key, double lat, double long) → void
Sets a location custom attribute.
setNestedCustomUserAttribute(String key, Map<String, dynamic> value, [bool merge = false]) → void
Sets a string typed custom attribute.
setPhoneNumber(String phoneNumber) → void
Sets the phone number default user attribute.
setPushNotificationSubscriptionType(SubscriptionType type) → void
Sets push subscription state for the current user.
setSdkAuthenticationSignature(String? sdkAuthSignature) → void
setStringCustomUserAttribute(String key, String value) → void
Sets a string typed custom attribute.
subscribeToContentCards(void onEvent(List<BrazeContentCard>)) StreamSubscription
Subscribes to the stream of content cards and calls onEvent when it receives the list of content cards.
subscribeToFeatureFlags(void onEvent(List<BrazeFeatureFlag>)) StreamSubscription
Subscribes to the stream of feature flags and calls onEvent when it receives the list of feature flags.
subscribeToInAppMessages(void onEvent(BrazeInAppMessage)) StreamSubscription
Subscribes to the stream of in-app messages and calls onEvent when it receives an in-app message.
subscribeToPushNotificationEvents(void onEvent(BrazePushEvent)) StreamSubscription
toString() String
A string representation of this object.
inherited
unsetCustomUserAttribute(String key) → void
Unsets a custom attribute.
updateTrackingPropertyAllowList(BrazeTrackingPropertyList allowList) → void
Updates the existing tracking property allow list. No-op on Android.
wipeData() → void
Wipes Data on board the SDK. Please consult iOS and Android-specific implementation details before using.

Operators

operator ==(Object other) bool
The equality operator.
inherited