Skip to content

Config file

Configuration file

Plot allows configuration of your plugin through a plotconfig.json file placed in your project. The folder for this file depends on your platform (see integration guides).

The configuration file should contain a json object, which may contain the the properties as described below.

The configuration file should contain your public token of your app, you can set it by adding the property publicToken and setting its value to it. You can find this token in the Plot Projects Dashboard. This property is required inside the configuration file.

You can also define whether or not Plot should automatically enable when an init method is called for the first time. It will remember calls to enable() or disable(). This property is not required, default is true.

An example plotconfig.json could look like this:

{
  "publicToken": "REPLACE_ME",
  "enableOnFirstRun": true
}

Since version 1.10.3 of our plugin we allow limiting the number of regions that can be monitored at once (iOS has a maximum of 20), so that another library using beacon or geofence regions can be used together with us. The other library would also have to use a similar setup by limiting their usage of the monitored regions.

You can set the maximum regions monitored by Plot by adding the property maxRegionsMonitored to the plotconfig.json. The value of the property should be an integer between 5 and 20.

Since plugin version 2.0.0, it is possible to disable the automatic location services opt-in dialog that is shown. Set automaticallyAskLocationPermission to false to disable this opt-in dialog.

Since the plugin version 2.3.0 we support Provisional Authorization for notifications, a feature that was introduced with iOS 12. In order to enable this feature, the provisionalNotificationPermission setting needs to be paired with automaticallyAskLocationPermission also set to true

The option provisionalNotificationPermission requires automaticallyAskLocationPermission to also be set to true. When provisionalNotificationPermission is set to true and automaticallyAskLocationPermission is set to false (or not present), the plugin will default to the automatic location services opt-in dialog (as if automaticallyAskLocationPermission was set to true and provisionalNotificationPermission to false.

Plugin version 3.4.0 introduces a private mode setting, this setting disables us from storing any users data from your app. You enable this option by setting privateMode to true. The default value is false.

An example plotconfig.json could look like this:

{
  "publicToken": "REPLACE_ME",
  "enableOnFirstRun": true,
  "maxRegionsMonitored": 10,
  "automaticallyAskLocationPermission": true,
  "provisionalNotificationPermission": true,
  "privateMode": true
}

Programmatic configuration

When you want to use another mechanism for specifying the configuration, then you can use the configuration hook. A use cases for this functionality is to load the config using your own configuration mechanism, for example when shipping the Plot Plugin as part of another library.

This feature requires at least version 2.1.0 for iOS or version 2.5.0 for Android. More information in Configuration Hook (iOS) or Configuration Hook (Android).