A sample React-Native application to start learning the power of Situm's React Native SDK Plugin.
Situm SDK is a set of utilities that allow any developer to build location based apps using Situm's indoor positioning system. Among many other capabilities, apps developed with Situm SDK will be able to:
- Obtain information related to buildings where Situm's positioning system is already configured: floor plans, points of interest, geotriggered events, etc.
- Retrieve the location of the smartphone inside these buildings (position, orientation, and floor where the smartphone is).
- Compute a route from a point A (e.g. where the smartphone is) to a point B (e.g. any point of interest within the building).
The first step is to download this repo:
git clone https://github.com/situmtech/react-native.gitThis repository uses yarn workspaces and yarn 4, so you will need to install Corepack and prepare yarn:
cd react-native/
npm install -g corepack
corepack enable
corepack prepare yarn@4.0.1 --activateThen install the plugin dependencies alongside the example/ app dependecies as follows:
yarn install && yarn workspace example install- iOS
In case you are using iOS, the last step is to install de dependencies specified in
example/ios/Podfilewith:
cd ios/
pod installFor this step you must create a situm account, so setup your account before continuing.
After creating your situm account, you must set your credentials on the properties of src/situm.tsx, like so:
export const SITUM_EMAIL = "";
export const SITUM_API_KEY = "";
export const SITUM_BUILDING_ID = ""; // Identifier of the building to be loaded using MapView.
export const SITUM_API_DOMAIN = "https://api.situm.com";You can use the contents of src/situm.tsx.example as example.
For security reasons, the file situm.tsx is ignored in this repository.
NOTE: You should also fill the SITUM_BUILDING_ID variable so the MapView is able to work as expected. In case you haven't created POIs or paths yet, learn how to create these cartography elements.
-
Run from command line:
- Initialize the metro terminal with
$ yarn workspace example start. - Then (in another terminal) compile and run this app in your device with
$ yarn example android.
- Initialize the metro terminal with
-
Run from Android Studio: Open
example/androidfolder in Android Studio and run project.
-
Run from command line:
- Initialize the metro terminal with
$ yarn workspace example start - Then (in another terminal) compile and run this app in your device with
$ yarn example ios.
- Initialize the metro terminal with
-
Run from XCode: Go to
example/iosfolder and openSitumReactNativeExample.xcworkspace.
More information on how to use the official React Native plugin and the set of APIs, the functions, parameters and results each function accepts and provides can be found in our Cordova JSDoc which shares interfaces.
In case you want to learn how to use our plugin, you may want to take a look at our code samples of the basics functionalities:
- Showcasing our SDK
- HomeScreen
- Positioning: Learn how to start positioning and get the user location by using our listener.
- Map Interaction: Learn how to interact with
MapViewfrom a different screen. - Fetch Resources: Learn how to fetch information about Situm cartography elements, such as buildings, POIs, and geofences.
- WayfindingScreen
- MapView: Learn how to integrate
MapViewfor a complete wayfinding experience. - Learn how to interact with the map, such as selecting a POI or starting navigation.
- MapView: Learn how to integrate
- HomeScreen
We use SemVer for versioning.
Please refer to CHANGELOG.md for a list of notables changes for each version of the library.
You can also see the tags on this repository.
You will need to sign a Contributor License Agreement (CLA) before making a submission. Learn more here.
This project is licensed under the MIT - see the LICENSE file for details.
More info is available at our Developers Page.
For any question or bug report, please send an email to support@situm.es


