Debug mode and log messages

Android

Note

You need to turn off debug before submitting to app store by setting "debug": false in your plotconfig.json

The Plot plugin provides log messages to help you diagnose situations where no notification is shown. For example, it helps you distinguish between situations where either our library thinks it isn't close enough to a location or the notification filter dropped the notification.

Since version 2.x, in order for Plot plugin to log these messages, you have to enable debug mode. That is done by setting debug to true in plotconfig.json. Notice the last line of the following code snippet:

{
  "publicToken": "YOUR_TOKEN",
  "enableOnFirstRun": true,
  "debug": true
}

The messages are then sent to LogCat. Most IDEs show these messages directly from there.

When enabling Plot you see the following log message:

10-04 10:53:27.362 5834-6480/com.example D/Plot/SettingsService: Enabling Plot plugin.

After the Plot plugin is enabled, it downloads the notifications from the server. It shows the total number of notifications and the notifications that have been loaded. You can use the following message to ensure the right notifications are loaded.

10-04 10:53:34.673 5834-6480/com.example D/Plot/BasicNotificationService: Received 39 notifications.

10-04 10:53:36.411 5834-6480/com.example D/Plot/BasicNotificationService: Loaded Notification{id='9f82ae0ad3b94a498bdbfb9f163d75a4',
    location=Location{latitude=52.373150255778086, longitude=4.905467582617121}, message='...', timespans=[], data='...', matchRange='4520', triggerOnExit='false',
    dwellingMinutes='0', cooldownGroups=[Cooldown{cooldownSeconds=1, groupName='9f82ae0ad3b94a498bdbfb9f163d75a4'}], landingPageNotification='false', geotrigger='false',
    isAppLinkNotification='false', segmentationIds='[]', segmentationProperties='[]'}

Once the notifications are loaded, Plot matches these. It shows the loaded notifications that and the distance to these notifications in meters. Where the distance is smaller than the match range, a notification "matches" and is sent to the notification filter (if you have one defined).

10-04 10:53:36.590 5834-6480/com.example D/Plot/GeofenceMatching: Checking for geofence matches.

10-04 10:53:36.693 5834-6480/com.example D/Plot/GeofenceMatching: Distance to 37939d977fa744339bcfbb1de5833b37;cbf373cfa41248ee837799099f5c99c0: 43 (match range: 200)

When there is at least one notification sent to the notification filter, then you see the following two lines. First the number of matching notifications, followed by details about these notifications. When you don't have a notification filter, then this step is skipped.

10-04 10:53:37.569 5834-6643/com.example D/Plot/NotificationFilterUtil: Received 1 notifications for filtering

10-04 10:53:37.578 5834-6643/com.example D/Plot/NotificationFilterUtil: FilterableNotification(id = 471b01eb41af436f9cb38196936a727c;41b1ce9a9f2140ce9512f03b4fafc04b, matchId = 82086267-d4b1-4eea-972c-95a841ffb3a2, message = 15/9 13:55 test quicksync, data = , notification = null, trigger = enter)

Once the notification filter completes, the following log message appears. It shows how many notifications passed through the notification filter and then shows them. These notifications then appear in the notification area.

10-04 10:53:37.669 5834-6643/com.example D/Plot/NotificationFilterUtil: 1 notifications passed

10-04 10:53:37.674 5834-6643/com.example D/Plot/NotificationFilterUtil: FilterableNotification(id = 471b01eb41af436f9cb38196936a727c;41b1ce9a9f2140ce9512f03b4fafc04b, matchId = 82086267-d4b1-4eea-972c-95a841ffb3a2, message = Wednesday: 15/9 13:55 test quicksync, data = , notification = null, trigger = enter)

Cordova/Phonegap

To enable debug logging on the iOS platform, you have to add a parameter to your project settings on XCode. Add DEBUG=1 to your Build Settings -> Project Preprocessor Macros in XCode. The following screenshot demonstrates where this parameter should be added:

Cordova debug mode