Retrieve notification status from plugin

As the plugin runs in the background, it is sometimes hard to see why the plugin doesn't send a notification. Starting from version 3.1 the Android plugin provides a screen that shows the nearest notifications and their current status. You can use this inside our demo app and you can add the functionality to your own app. At the moment this functionality is only available for Android.

Using the demo app

The easiest way to see this debug screen is to use our demo app. Then no developer has to integrate the screen into an existing app. To get started, download the Android Demo app. On the top of the screen, you open the tab "Status".

Integrating into your own app

Besides from using this from our demo app, you can integrate this overview into your app to aid debugging. You have the simple option to show an Activity and the more advanced option to integrate a fragment into an existing activity. The functionality only works when the debug property is set to true in plotconfig.json.

Showing the Activity is the simplest and is done like this:

Intent consoleActivityIntent = new Intent(context, ConsoleActivity.class); context.startActivity(consoleActivityIntent)

If you want to integrate this into an existing screen, you can also use a fragment. It comes in two flavors:

  • com.plotprojects.retail.android.ConsoleFragment: Extends the Support Fragment class.
  • com.plotprojects.retail.android.ConsoleFragment.NativeFragment: Extends the native Fragment class.
Possible notification statuses

The screen shows the details of the last execution and a list of the nearest notifications sorted on distance.

For the details of the last execution it shows the following properties:

  • Last Geofence check: Last time the plugin searched for nearby geofences.
  • Last Beacon check: Last time the plugin searched for nearby beacons.
  • Last location: The coordinates of the last reported location.
  • Last location accuracy: The accuracy of the last reported location.
  • Last full update: Last time all geofences/beacon/campaigns inside a large area were updated.
  • Last quick update: Last time the geofences/beacon/campaigns inside a small area were updated.

For each notification it shows the following properties:

  • Distance to edge: The distance in meters the device thinks you currently are away from the edge of the geofence.
  • Region Type: Whether it is a geofence or beacon notification.
  • Trigger type: Whether the notification shows the user enters or exits the geofence.
  • Notification Message: The message of the notification.
  • Last received: The last time the notification was shown.
  • Notification status: When the notification isn't sent, then it shows the reason here.

Notification Status

If no notifications can be loaded, then it prints the reason why this happened. Possible reasons include: "No internet connection", "The location of the device cannot be determined" or "No campaigns are active".