MBAutomation is a plugin libary for MBurger, that lets you send automatic push notifications and in-app messages crated from the MBurger platform. It has as dependencies MBMessages and MBAudience. With this library you can also track user events and views.

Using MBAutomation you can setup triggers for in-app messages and push notifications, in the MBurger dashboard and the SDK will show the coontent automatically when triggers are satisfied.

It depends on MBAudience because messages can be triggered by location changes or tag changes, coming from this SDK.

It depends on MBMessages because it contains all the views for the in-app messages and the checks if a message has been already displayed or not.

The data flow from all the SDKs is manage entirely by MBurger, yuo don't have to worry about it.

MBAutomation depends on the following packages:


You can install the MBAudience SDK using pub, add this to your pubspec.yaml file:

  mbautomation: ^2.0.0

And then install packages from the command line with:

$ flutter pub get


To initialize automation you need to insert MBAutomation as an MBurger plugin, tipically automation is used in conjunction with the MBMessages and MBAudience plugins.

MBManager.shared.plugins = [
  ... other plugins

MBAutomation can bbe initialized with 3 optional parameters:

  • trackingEnabled: If the tracking is enabled or not, setting this to false all the tracking will be disabled
  • eventsTimerTime: The frequency used to send events and views to MBurger


Every in-app message or push notification coming from MBurger can have an array of triggers, those are managed entirely by the MBAutomation SDK that evaluates them and show the mssage only when the conditioon defined by the triggers are matched.

If thre are more than one trigger, they can be evaluated with 2 methods:

  • any: once one of triggers becomes true the message is displayed to the user
  • all: all triggers needs to be true in order to show the message.

Here's the list of triggers managed by automation SDK:

App opening

MBAppOpeningTrigger: Becoomes true when the app has been opened n times (times property), it's checked at the app startup.


MBEventTrigger: Becomes true when an event happens n times (times property)

Inactive user

MBInactiveUserTrigger: Becomes true if a user has not opened the app for n days (days parameter)


MBLocationTrigger: If a user enters a location, specified by latitude, longitude and radius. This trigger can be activated with a day delay defined as the afterDays property. The location data comes from the MBAudience SDK.

Tag change

MBTagChangeTrigger: If a tag of the MBAudience SDK changes and become equals or not to a value. It has a tag property (the tag that needs to be checked) and a value property (the value that needs to be equal or different in order to activate the trigger)


MBViewTrigger: it's activated when a user enters a view n times (times property). If the secondsOnView the user needs to stay the seconds defined in order to activate the trigger.

Send events

You can send events with MBAutomation liike this:


You can specify 2 more parameters, both optional: name a name that will be displayed in the MBurger dashboard and a map of additional metadata to specifymore fields of the event

  name: "PURCHASE",
  metadata: {"quantity": 1},

Events are saved in a local database and sent to the server every 10 seconds, you can change the frequency setting the eventsTimerTime property.

View Tracking

To track views automatically add an instance of MBAutomationNavigatorObserver to the navigatorObservers of your app, like this:

Widget build(BuildContext context) {
  return MaterialApp(
    navigatorObservers: [MBAutomationNavigatorObserver()],
    home: ...,

The navigator observer will send the name of the PageRoute ( tto MBurger whenever a new route is pushed or popped.

If you don't wnat to use the navigator observer you can use this function, to track a view manually.


As the events, views are saved in a local database and sent to the server every 10 seconds and you can change the frequency setting the eventsTimerTime property.