Situm Wayfinding for React Native. Integrate plug&play navigation experience with indoor maps, routes and turn-by-turn directions in no time. With the power of Situm.
Situm React Native Plugin is a set of utilities that allow any developer to build React Native location based apps using Situm's indoor positioning system.
This plugin has two parts:
The base SDK, the building blocks that allow you to:
A full featured and easy to integrate React Native component that allows you to:
There is a comprehensive tutorial on how to set-up a new application using this plugin on the Situm documentation page.
Below you will find the basic steps to install and configure the plugin on your React Native project. These steps have already been done for you in the example application of this repository, but they are required for other projects.
Check the example/README file of this repository to create your first React Native application using Situm React Native. In this example app you will find example screens for each method the plugin exposes.
Firstly you need to setup react-native development environment. To get started please follow instructions under section React Native CLI Quickstart on this guide.
To add the Situm dependency to your React Native project, you can use the yarn
or npm
command. To add this dependency to your project, you can use the following command in your terminal:
yarn add @situm/react-native react-native-webview
#OR
npm install --save @situm/react-native react-native-webview
Follow the Wayfinding guide if you haven't set up a Situm account.
After that, authenticate your app by calling the setApiKey()
method.
SitumPlugin.init();
SitumPlugin.setApiKey("YOUR_SITUM_API_KEY");
ACCESS_FINE_LOCATION
permission to your AndroidManifest.xml
file if you have configured Situm SDK to use GPS: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
minSdkVersion
to 21 or later on your app's build.gradle
file.PodFile
target 'YourApp' do
pod 'ReactNativeSitumPlugin', :path => '../node_modules/@situm/react-native/ReactNativeSitumPlugin.podspec'
end
You may need to add a Header Search Path: (screenshot)
$(SRCROOT)/../node_modules/@situm/react-native/lib/ios
Info.plist
file to successfully start positioning:<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>
WKAppBoundDomains
on Info.plist
as follows:<key>WKAppBoundDomains</key>
<array>
<string>maps.situm.com</string>
</array>
The new Situm React Native package breaks compatibility with the previous Situm React Native Wayfinding plugin. Integrating the new version is simpler and more straightforward. If you want to migrate your application, follow the steps described in the Situm documentation.
yarn
yarn test
Situm-React-Native-Plugin is licensed under MIT License
This will also generate the docs (see next section). More info is available at our Developers Page.
yarn run doc
Docs will be available in the docs/ folder.
Please refer to CHANGELOG.md for a list of notable changes for each version of the plugin.
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 further details.
More info is available at our Developers Page.
For any question or bug report, please send an email to [email protected]