How to use beacons with Matchmore

Learn how to use beacons with Matchmore. This blog post will teach you how to integrate beacons with us to your project. This tutorial is simple, easy to follow and well-explained. Enjoy!

How to use beacons with Matchmore

In a previous post, we already gave you the basics on what beacons are. If you a beginner with beacons, we recommend that you read our blog post Everything you need to know about beacons. We explained how they can be used, as well as what's the difference between different protocols and brands. This blog post, however, will guide you how to use beacons with us. Enjoy!  

There are two advantages to use beacons with Matchmore. First, the publication's properties allow you to attach meaningful information with your beacons. Second, you are able to work with pin points on a macro-level scale (meters to kilometers) and beacons on a micro-level scale (centimeters to meters); combine both scales and outdoor-indoor service at once in a unique integrated cloud Backend-as-a-Service.

Start using beacons with Matchmore

First you need to register the beacons in your account on Matchmore. Go to your account dashboard by connecting on Matchmore's portal.

When you are logged in, click on "Beacons" in the user menu.

Register all the beacons you plan to use.

Then, you can start assign your beacons in your app.

Your beacons are ready to be used with Matchmore, you can now use the generated device ID to publish or subscribe on your beacons.

That's how easy it is !

Two ways to publish on the beacons

Let's assume that you are developing an application for a museum. You want to create mobile notifications based on a visitor’s proximity to an object.

And you have the beacon with Major 53494 and Minor 28090 placed near your famous piece of art painted by Van Gogh in June 1889.

There is many ways to publish on the beacons, but here we present two of them.

  • Via our portal without any lines of code
  • HTTP request with Curl

Note: you can also publish on your beacons via our SDKs.

On the portal (No code needed)

When you are logged-in, after you have registered all your beacons and assigned them to your application.

  1. Check which beacon corresponds to the Major 53494 and Minor 28090.
  2. Click on tools in the menu bar,
  3. and then on Create a Publication.

It brings you to the page where you can create publication in your app without coding anything.

  1. Choose the application for which you want to publish
  2. Choose the device. The beacon corresponding to the Major 53494 and Minor 28090 is our namely, Beetroot.
  3. Set the topic, it could be museum-beacon.
  4. Choose the range, as we want people to be very close to the Van Gogh before receiving a notification, we set 3 meters.
  5. We have set 86400 seconds which correspond to a month duration.
  6. Set the properties, that is metadata attached to our beacon.
  7. Press Publish, to publish your publication.

HTTP request with Curl

Here is another way to publish on your beacons. You are going to use HTTP request with Curl.

First, you need to access and get the device ID of the beacon on which you want to publish. You can access all the available beacons in an app by calling the following GET request:

Here is an example with Curl:

curl -X GET \ \
-H 'api-key: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJhbHBzIiwic3ViIjoiYmM1Y2EwNTgtZGQ4Yi00ZWZmLWFkMjYtZjg4MmI4OTZiNzMzIiwiYXVkIjpbIlB1YmxpYyJdLCJuYmYiOjE1MTU0MjQwMTYsImlhdCI6MTUxNTQyNDAxNiwianRpIjoiMSJ9.m6tVQ8oqWTe8Ne0M0rdZVhwprdEmoSZoP7wg5zM97rlo_n4c_Mks2Cqj4mZsvqM6mczJBm6wtydNnCQvqCZ1Ig' \
    -H 'content-type: application/json' \

The returned result will be a JSON describing all the available beacons in the given api-key app:

{ "deviceId": "38143334-1f0d-4d62-a5a0-67c2b8cd6a53", "proximityUUID": "b9407f30-f5f8-466e-4393-25556b57fe6d", "major": 1000, "minor": 40050}, 
{ "deviceId": "fb705200-13fc-4491-b20f-ce58db97ade8", "proximityUUID": "b9407f30-f5f8-466e-aff9-25556b57fe6d", "major": 53494, "minor": 28090}, 
{ "deviceId": "a2eea8e6-ffc4-467e-ad65-68d01da8d309", "proximityUUID": "b9407f30-f5f8-466e-aff9-25556b57fe6d", "major": 203, "minor": 1230} 

With the known device ID, you are able to start publishing or subscribing from your beacons.

You are looking for the beacon with Major 53494 and Minor 28090 placed near your famous piece of art painted by Van Gogh in June 1889.

Use the device ID which is fb705200-13fc-4491-b20f-ce58db97ade8.

Set your publication with Curl:

Provide the significant information in the properties.

curl -X POST \ \ 
-H 'api-key: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJhbHBzIiwic3ViIjoiYmM1Y2EwNTgtZGQ4Yi00ZWZmLWFkMjYtZjg4MmI4OTZiNzMzIiwiYXVkIjpbIlB1YmxpYyJdLCJuYmYiOjE1MTU0MjQwMTYsImlhdCI6MTUxNTQyNDAxNiwianRpIjoiMSJ9.m6tVQ8oqWTe8Ne0M0rdZVhwprdEmoSZoP7wg5zM97rlo_n4c_Mks2Cqj4mZsvqM6mczJBm6wtydNnCQvqCZ1Ig' \
-H 'content-type: application/json' \
-d '{ "deviceId": "fb705200-13fc-4491-b20f-ce58db97ade8", "worldId": "bc5ca058-dd8b-4eff-ad26-f882b896b733", "topic": "museum-beacon", "range": 3, "duration": 86400, "properties": { "painter": "Vincent Willem van Gogh", "movement": "Post-Impressionism", "name": "The Starry Night"} }' 

You have the publication on the beacon and now what ?

So, for a subscriber on topic museum-beacon to pass near by the beacon (below 3 meters relative distance), will receive a match. This match can trigger pre-implemented feature and this match provide useful information based on the properties you have set before. When you know which beacons the end user has been near you can notify him with relevant contents ; for example, display a page with The Starry Night painting information, because the end user is near the "Beetroot" beacon.

That would be a good exercise for you:

  • Set a subscription on topic museum-beacon on a mobile device
  • Get the match
  • Implement a feature

Final comments

We hope you enjoyed this blog post. If you have any questions, please feel free to contact us.

Also, please explore our other blog posts about beacons:

Everything you need to know about beacons.

How to secure your beacons from being spoofed.