Take advantage of being part of our partner network and you will be able to offer the latest technology in indoor location with our training, commercial and support resources.
Explore our latest news, webinars, whitepapers, and dive into our map and app galleries. Access all the documentation and resources you need to get the most out of Situm’s technology.
Situm SDK can be used to build Wayfinding and Tracking applications, and dozens of use cases within those realms. In this guide we will walk you through the steps to build a basic React Native app that uses our @situm/react-native plugin to display your building’s cartography.
A Situm building set up and calibrated. You can use our Situm Mapping Tool for this.
A React Native development environment up and running, including a compatible smartphone or emulator. If this is your first React Native project, follow the Set Up Your Environment guide on the official React Native site to install Node, a JDK, Android Studio and/or Xcode.
The Situm React Native plugin can be integrated in two different kinds of projects. Pick the one that best fits your case and follow the corresponding section below:
Using Expo. The simplest path if you’re starting a new app. You’ll use create-expo-app and the Expo CLI. Note that the Situm plugin does not work in the Expo Go app — you need a development build, which is what this guide walks you through.
Using the React Native CLI (no framework). Use this if you need full control over the native project or you’re integrating Situm into an existing app built with @react-native-community/cli.
Follow one of the two options below to create and prepare your project, then continue with the common steps further down (configure permissions, add the Situm code, run the app).
npx create-expo-app@latest my-indoor-location-app
cd my-indoor-location-app
If you haven’t set up simulators or devices yet, follow Expo’s Set up your environment guide (select “Development build” and “Build locally”) before continuing.
# Using npm (recommended)
npm install --save @situm/react-native react-native-webview
# Or using Yarn Classic (1.x)
yarn add @situm/react-native react-native-webview
Heads up — Yarn Berry (2.x / 3.x / 4.x): If you use Yarn Berry with its default PnP/zip cache, React Native CLI commands such as run-android can fail with an error like spawnSync .../setup_env.sh ENOTDIR, because the CLI tries to execute a shell script from inside a compressed cache. To avoid this, use npm, use Yarn Classic (1.x), or configure Berry by adding nodeLinker: node-modules to your .yarnrc.yml.
Add the ACCESS_FINE_LOCATION permission declaration to your android/app/src/main/AndroidManifest.xml (you can omit this step if you have configured Situm SDK not to use GPS):
You will also need to include the following permissions in your app’s Info.plist file (modify the permission’s informative texts as you wish):
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSMotionUsageDescription</key>
<string>We use your phone sensors (giroscope, accelerometer and altimeter) to improve location quality</string>
Open your app’s entry file and replace its contents with the snippet below:
In a default Expo project (with expo-router), edit app/index.tsx.
In a React Native CLI project — or an Expo project created with --template blank — edit App.tsx at the project root.
The snippet below uses the App/App.tsx naming. If you’re using expo-router, save the file as app/index.tsx and rename the exported component from App to Index.
iOS note: Situm uses CocoaPods to manage iOS dependencies. If the build fails after updating the plugin, run cd ios && pod repo update && pod install and try again.
The snippet uses two main building blocks from our plugin:
MapView — the React Native component that displays the building’s cartography. Add it to your view hierarchy and configure it with your building identifier, API key and profile.
SitumProvider — a wrapper that the Situm plugin uses to keep its internal state. You must wrap any screen that uses Situm with it, or wrap your entire application.
Starting in @situm/react-native@3.15.0, the SDK can automatically request the permissions needed for positioning and handle common sensor issues (e.g. BLE or Location disabled) for you. You can enable this by calling:
SitumPlugin.enableUserHelper();
This is a convenience shortcut and is entirely optional. If you’d rather manage permissions yourself (for example, with react-native-permissions), you can omit this call. You can also customise the UI with your own colour scheme via SitumPlugin.configureUserHelper(UserHelperOptions).
Take a look at our example app, which contains different examples on how to perform several other actions using Situm.
To further configure the user experience, see our Advanced Topics section, which covers additional capabilities of both Situm SDK and MapView. Topics you may be interested in include: battery efficiency, location cache, working offline with cached data, foreground and background execution, external provider locations, listening to geofence entries and exits, providing your iOS app’s privacy manifest, and configuring the MapView UX.
Thank you for downloading our whitepaper. Please do not hesitate to contact us if you would like to know more about how our solutions can help your business.
Download whitepaper