Xamarin integration guide

We assume in this guide you already have an account for our dashboard. Don't have an account yet? Schedule a demo and we'll invite you to your account.

Step 1: Both iOS & Android

Our library supports both iOS and Android. We recommend installing our plugin through NuGet as it automatically ensures the right version of our library is included. You can find the plugin in the NuGet gallery under the name "PlotProjects.Plugin".

It is possible to make use of the IPlot interface in your own portable library projects, but then you still have to add the Plot Projects Xamarin Plugin to the platform specific projects as well.

Step 2: Android Step Only

You can skip this section when your app doesn't need Android support.

Place plotconfig.json in the Assets folder of your Android project. You can configure Plot through the configuration file. You can find an example config file and your public token on the Developer page on our dashboard.

Step 3: Android Step Only

You can skip this section when your app doesn't need Android support.

Call PlotProjects.Plugin.Plot.GetInstance(activity) from the OnCreate method of one of your activities.

Known issue for Android: When the Android Package name contains a dash or an underscore the mail debug log feature doesn't work. You can fix this by adding the following element to the application element of your AndroidManifest, with YOUR_PACKAGE_NAME replaced:

<provider
   android:authorities="YOUR_PACKAGE_NAME.plot.debuglogprovider"
   android:name="com.plotprojects.retail.android.DebugLogProvider"
   android:exported="true" />

When your android package name doesn't contain any special characters, no steps are required.

Step 4: iOS Step Only

You can skip this section when your app doesn't need iOS support.

Place plotconfig.json in the Resources folder of your project. You can configure Plot through the configuration file. You can find an example config file and your public token on the Developer page on our dashboard.

Step 5: iOS Step Only

Add the following line to your FinishedLaunching method in your AppDelegate:

PlotProjects.Plugin.Plot.GetInstance(launchOptions, true);

Step 6: iOS Step Only

Add in Info.plist under the Source tab the keys from the table below. Each value must be a message for the user describing why your app uses the location of the device. For example: "Your location is used to instantly inform you when you are near a location that is interesting to you."

Required key Description shown in Visual Studio
NSLocationAlwaysUsageDescription Privacy - Location Always Usage Description
NSLocationWhenInUseUsageDescription Privacy - Location When In Use Usage Description
NSLocationAlwaysAndWhenInUseUsageDescription Privacy - Location Always and When In Use Usage Description

This text is shown when permission to use the location of the device is requested. Note that for the app to be accepted in the App Store, the description why the app needs location services must be clear to the end user.

You are now ready to receive your first notification. For more details, look at our Github page.

Need more help during testing, look at the testing section of the documentation.