BrazePlugin constructor
BrazePlugin({})
The plugin used to interface with all Braze APIs with optional parameters specific customization.
Each of the different handlers can subscribe to their respective streams at plugin initialization. These can also be subscribed at a later time after initialization
Implementation
BrazePlugin(
{Function(BrazeInAppMessage)? inAppMessageHandler,
Function(BrazeSdkAuthenticationError)? brazeSdkAuthenticationErrorHandler,
Function(List<BrazeContentCard>)? contentCardsHandler,
Function(List<BrazeFeatureFlag>)? featureFlagsHandler,
Function(BrazePushEvent)? pushEventHandler,
Map<String, bool>? customConfigs}) {
_brazeCustomConfigs = customConfigs;
_brazeSdkAuthenticationErrorHandler = brazeSdkAuthenticationErrorHandler;
if (inAppMessageHandler != null) {
subscribeToInAppMessages(inAppMessageHandler);
}
if (contentCardsHandler != null) {
subscribeToContentCards(contentCardsHandler);
}
if (featureFlagsHandler != null) {
subscribeToFeatureFlags(featureFlagsHandler);
}
if (pushEventHandler != null) {
subscribeToPushNotificationEvents(pushEventHandler);
}
// Called after setting up plugin settings
_channel.setMethodCallHandler(_handleBrazeData);
}