braze_plugin 0.3.0

Braze Flutter SDK #

Effective marketing automation is an essential part of successfully scaling and managing your business.

This project contains the Braze plug-in package, a specialized package that allows integrators to use certain Braze APIs from Flutter app code written in Dart.

Getting Started #

  1. Follow the directions in the Install Tab to import Braze into your project.

  2. Instantiate an instance of the Braze plugin by calling new BrazePlugin()

Android #

  1. In your res/values directory, create a file called appboy.xml and add your API key and set your custom endpoint as specified in our public documentation.

  2. Add required permissions to your AndroidManifest, as specified in our public documentation.

  3. To integrate push, follow the directions in our [public documentation(https://www.braze.com/docs/developer_guide/platform_integration_guides/android/push_notifications/integration/). Note that only registration using our "automatic FCM registration" is currently supported from Flutter apps.

iOS #

  1. Call Appboy.startWithApiKey() in your AppDelegate's didFinishLaunchingWithOptions delegate method as specified in our [public documentation])(https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/initial_sdk_setup/initial_sdk_setup/#step-4-updating-your-app-delegate).

  2. Set your custom endpoint as specified in our public documentation. We recommend the Info.plist approach.

In-app messages #

Disabling automatic display #

Native in-app messages display automatically out of the box on Android and iOS.

To disable automatic in-app message display for Android, implement the IInAppMessageManagerListener delegate as described in our public documentation. Your beforeInAppMessageDisplayed method implementation should return InAppMessageOperation.DISCARD. For an example, see MainActivity.kt in our example app.

To disable automatic in-app message display for iOS, implement the ABKInAppMessageControllerDelegate delegate as described in our public documentation. Your beforeInAppMessageDisplayed delegate implementation should return ABKInAppMessageDisplayChoice.discardInAppMessage. For an example, see AppDelegate.swift in our example app.

In-app message data callback #

You may set a callback in Dart to receive Braze in-app message data in the Flutter host app. Note that analytics are not currently supported on messages displayed through the callback.

To set the callback, call BrazePlugin.setBrazeInAppMessageCallback() from your Flutter app with a function that takes a BrazeInAppMessage instance. The BrazeInAppMessage object supports a subset of fields available in the native model objects, including uri, message, header, buttons, and extras.

On Android, you will additionally need to implement the IInAppMessageManagerListener delegate as described in our public documentation. Your beforeInAppMessageDisplayed method implementation must call BrazePlugin.process(inAppMessage). For an example, see MainActivity.kt in our example app.

On iOS, you will additionally need to implement the ABKInAppMessageControllerDelegate delegate as described in our public documentation. Your beforeInAppMessageDisplayed delegate implementation must call BrazePlugin.process(inAppMessage). For an example, see AppDelegate.swift in our example app.

To log analytics using your BrazeInAppMessage, pass the instance into the logInAppMessageClicked, logInAppMessageImpression, and logInAppMessageButtonClicked methods available on the main plugin interface.

0.3.0 #

Breaking #
  • The native iOS bridge uses Braze iOS SDK 3.15.0.
  • The native Android bridge uses Braze Android SDK 3.5.0.
  • Support for the Android configuration parameter com_appboy_inapp_show_inapp_messages_automatically has been removed.
    • To control whether an in-app message object should be displayed natively or not, create and register an instance of IInAppMessageManagerListener in your native Android code and implement decisioning in the beforeInAppMessageDisplayed method. See MainActivity in our sample app for an example.
  • On Android, in-app message objects are no longer sent automatically to the Dart in-app message callback after calling BrazePlugin.setBrazeInAppMessageCallback() in your Dart code.
    • Similar to iOS, you will need to implement a delegate interface in your native app code and pass in-app message objects to the Dart layer for passing to the callback.
    • On Android, the delegate interface is IInAppMessageManagerListener and the method for passing objects to Dart is BrazePlugin.processInAppMessage(inAppMessage).
    • See the sample IInAppMessageManagerListener implementation in the MainActivity.kt file of our sample app for an example.
    • This approach gives the integrator more flexibility in deciding when a message should be displayed natively, discarded, or passed into the Dart layer.
Added #
  • Added support for logging in-app message analytics to the Braze interface using BrazeInAppMessage instances. See logInAppMessageClicked, logInAppMessageImpression, and logInAppMessageButtonClicked.

0.2.1 #

Added #
  • Added the following new fields to BrazeInAppMessage: imageUrl, useWebView, duration, clickAction, dismissType, messageType
  • Added the following new fields to BrazeButton: useWebView, clickAction.

0.2.0 #

Breaking #
Added #
  • Adds addAlias() to the public API interface.
  • Adds requestLocationInitialization() to the public API interface.
  • Adds getInstallTrackingId() to the public API interface.
  • Adds support for disabling native in-app message display on Android.
    • To disable automatic in-app message display, create a boolean element named com_appboy_inapp_show_inapp_messages_automatically in your Android app's appboy.xml and set it to false.
    • Note: Disabling automatic in-app message display was already possible for iOS. For instructions, see README.md.
  • Adds a Dart callback for receiving Braze in-app message data in the Flutter host app.
    • Analytics are not currently supported on messages displayed through the callback.
    • To set the callback, call BrazePlugin.setBrazeInAppMessageCallback() from your Flutter app with a function that takes a BrazeInAppMessage instance.
      • The BrazeInAppMessage object supports a subset of fields available in the native model objects, including uri, message, header, buttons, and extras.
    • The callback should begin to function on Android immediately after being set.
    • On iOS, you will additionally need to implement the ABKInAppMessageControllerDelegate delegate as described in our public documentation. Your beforeInAppMessageDisplayed delegate implementation must call BrazePlugin.process(inAppMessage). For an example, see AppDelegate.swift in our example app.

0.1.1 #

  • Formatted braze_plugin.dart.

0.1.0 #

  • Removes the unused dart:async import in braze_plugin.dart.
  • Makes _callStringMethod private in braze_plugin.dart.
  • Adds basic dartdoc to the public API interface.

0.0.2 #

  • Updates the version of Kotlin used by the Android plugin from 1.2.71 to 1.3.11.

0.0.1 #

example/README.md

braze_plugin_example #

Demonstrates how to use the braze_plugin plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  braze_plugin: ^0.3.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:braze_plugin/braze_plugin.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/braze_plugin.dart.

Run flutter format to format lib/braze_plugin.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8

Admin