Home

Awesome

ACR ESTIMOTES PLUGIN FOR XAMARIN


This is a cross platform implementation of the estimote library for beacons. It will allow you to make beacon calls for your PCL library. Please be sure to read through the samples found in this repository!

This library currently only supported on iOS and Android. You can get it on nuget at https://www.nuget.org/packages/Estimotes.Xplat/

SETUP

iOS

Make sure to install the nuget package in your platform project. In your Info.plist, add the following key:

<!-- needed for background monitoring or foreground ranging-->
<key>NSLocationAlwaysUsageDescription</key>
<string>ENTER YOUR REASON FOR LOCATION TRACKING</string>

<!-- if you don't need background monitoring, use this -->
<key>NSLocationWhenInUseDescription</key>
<string>ENTER YOUR REASON FOR LOCATION TRACKING</string>

Android

Make sure to install the nuget package in your platform project. Android 4.3+ is required!

You need to add BLUETOOTH and BLUETOOTH_ADMIN privileges to your android project

USAGE

First thing to do is initialize the plugin

var status = await EstimoteManager.Instance.Initialize(); // optionally pass false to authorize foreground ranging only
if (status != BeaconInitStatus.Success) {
    ... You have a problem with permissions or bluetooth is unavailable on the device, use the enum to figure out what!
}

Now hook up to the event(s) you want to use

EstimoteManager.Instance.Ranged += (sender, beacons) => {};
EstimoteManager.Instance.RegionStatusChanged += (sender, region) => {};

And to actually start or stop the process (optionally, you can also pass major/minor combinations)

// for exact distancing, use ranging - requires your app to be in the foreground
EstimoteManager.Instance.StartRanging(new BeaconRegion("Beacon Identifier", "Your UUID"));
EstimoteManager.Instance.StopRanging(new BeaconRegion("Beacon Identifier", "Your UUID"));

// for background monitoring when you don't care about actual distance
EstimoteManager.Instance.StartMonitoring(new BeaconRegion("Beacon Identifier", "Your UUID"));
EstimoteManager.Instance.StopMonitoring(new BeaconRegion("Beacon Identifier", "Your UUID"));

FAQ

  1. What is the difference between ranging and monitoring?
  1. Does this library support other brands of manufacturuers?
  1. I'm monitoring by UUID, but the major and minor values do not come back for a beacon
  1. How many regions can I monitor/range at one time?
  1. Estimote.iOS.Binding doesn't compile