Skip to content

Latest commit

 

History

History
138 lines (88 loc) · 7.14 KB

README.md

File metadata and controls

138 lines (88 loc) · 7.14 KB

Situm React Native SDK sample app

A sample React-Native application to start learning the power of Situm's React Native SDK Plugin.

npm npm TypeScript

Getting Started

home_preview positioning_preview map_preview

What's in here

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:

  1. Obtain information related to buildings where Situm's positioning system is already configured: floor plans, points of interest, geotriggered events, etc.
  2. Retrieve the location of the smartphone inside these buildings (position, orientation, and floor where the smartphone is).
  3. 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).

How to run the app

Step 1: Install the dependencies

The first step is to download this repo:

git clone https://github.com/situmtech/react-native.git

And then install the plugin dependencies alongside the example/ app dependecies as follows:

cd situm-react-native-plugin/;

yarn install;
yarn example install;
  • iOS In case you are using iOS, the last step is to install de dependencies specified in example/ios/Podfile with:
cd ios/
pod install

Step 2: Set your credentials

For this step you must create a situm account, so setup your account before continuing. After creating your situm account, you can 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
export const SITUM_DASHBOARD_URL = 'https://dashboard.situm.com';

NOTE: You should also fill the SITUM_BUILDING_ID and SITUM_FLOOR_ID variables so all the examples are able to work as expected. In case you haven't created POIs or paths yet, learn how to create these cartography elements.

Step 3: Run the app

Android

  • Run from command line:

    1. Initialize the metro terminal with $ react-native start
    2. Then (in another terminal) compile and run this app in your device with $ react-native run-android.
  • Run from Android Studio: Open root/android folder in Android Studio and run project.

iOS

  • Run from command line:

    1. Initialize the metro terminal with $ react-native start
    2. Then (in another terminal) compile and run this app in your device with $ react-native run-ios.
  • Run from XCode: Go to example/ios folder and open example.xcworkspace or run command xed ios from root directory.

Documentation

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.

Examples

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:

Versioning

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.

Submitting Contributions

You will need to sign a Contributor License Agreement (CLA) before making a submission. Learn more here.

License

This project is licensed under the MIT - see the LICENSE file for details.

More information

More info is available at our Developers Page.

Support information

For any question or bug report, please send an email to [email protected]