BrazePlugin constructor
BrazePlugin({})
The plugin used to interface with all Braze APIs with optional parameters specific customization.
The inAppMessageHandler
and contentCardsHandler
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,
Map<String, bool>? customConfigs}) {
_brazeCustomConfigs = customConfigs;
_brazeSdkAuthenticationErrorHandler = brazeSdkAuthenticationErrorHandler;
if (inAppMessageHandler != null) {
subscribeToInAppMessages(inAppMessageHandler);
}
if (contentCardsHandler != null) {
subscribeToContentCards(contentCardsHandler);
}
if (featureFlagsHandler != null) {
subscribeToFeatureFlags(featureFlagsHandler);
}
// Called after setting up plugin settings
_channel.setMethodCallHandler(_handleBrazeData);
}